This way of installing Jupyter Lab allows you to install it once and any virtual env has access to Jupyter through ipykernel.
- Install pyenv (w/ virtualenv)
- Install a new version of python
pyenv install <a new python version>
- Set a global version of python
pyenv global <new python version>
- Install pipx
- Install Jupyter Lab using pipx. Pipx should be using pyenv's python global python version. (
which pipx
to check). - Create a virtual env
pyenv virtualenv <python version> <name of venv>
- Activate virtual env
pyenv activate <name of venv>
pip install ipykernel
python -m ipykernel install --user --name <name of venv> --display-name "Python (<name of venv>)"
Successul output will look like:
Installed kernelspec geopy39 in /home/username/.local/share/jupyter/kernels/geopy39