pyenv jupyter lab working despite not showing up in pip freeze

Viewed 142

I created a virtual environment with pyenv and installed one package from git using pip (you can find it here).

Then, with the environment activated, I decided to run in bash the command jupyter lab even though I knew it is not installed yet through pip on this new environment. But to my surprise, it worked!

I would like to understand why it worked because I thought i had to have it installed through pip on this new environment.

Here is the output of which jupyter lab:

/Users/<myHiddenUser>/.pyenv/shims/jupyter

And here's the output of pip freeze on the virtual environment:

certifi==2020.4.5.1
cffi==1.14.0
chardet==3.0.4
conda==4.8.3
conda-package-handling==1.7.0
cryptography==2.9.2
idna==2.9
pycosat==0.6.3
pycparser==2.20
pyOpenSSL==19.1.0
PySocks==1.7.1
requests==2.23.0
ruamel-yaml==0.15.87
six==1.14.0
tqdm==4.46.0
urllib3==1.25.8
1 Answers

I'm not really sure of my answer, but from what I understand, jupyter is more like an external program than a python library, sure it can be installed through pip, but so does QtDesigner (Qt is not made for python but for the entire Qt library, thats made with C++, but it can be used with pyqt5).

That's why, for example, I can use jupyter notebook with a nodejs kernel (javascript) and so on, if it is installed on your computer you can pretty much open any directory and run any code kernel that supports it.

With that said, it's been a long time since I used a virtual environment with python, so did you happen to open jupyter without changing to the environment? if so then of course is gonna work, if not, well maybe the virtualenv can use external programs.

Hope this helps a little :D.

Related