#
Installing Jupyter
#
Create new environment for Jupyter
First, we create a new environment where Jupyter will live. You can then do whatever you want without messing with other environments. I called it "jupyter", but it can be anything else.
pyenv virtualenv 3.10.2 jupyter
pyenv activate jupyterlab
pip install --upgrade pip
Install Jupyter Lab (this also installs Jupyter Notebook!).
pip install jupyterlab
And there you go! Anytime you want so start up jupyter, just run
pyenv activate jupyter
jupyter lab
#
Register environments to use in Jupyter
In general, you should not be working in Jupyter's virtualenv, to avoid polluting it with unnecessary packages. Now, we need to make sure that Jupyter knows about the virtual environments that we work on.
pyenv virtualenv 3.10.2 myenv
pyenv activate myenv
pip install --upgrade pip
For Jupyter to recognize the environment, you need to install a new IPython Kernel
pip install ipykernel
Now, all you need is to register the new environment, so that Jupyter knows about it:
ipython kernel install --name myenv --user
Reference:
https://queirozf.com/entries/jupyter-kernels-how-to-add-change-remove