Blog

Brandon Rozek

Photo of Brandon Rozek

PhD Student @ RPI studying Automated Reasoning in AI and Linux Enthusiast.

Jupyter with Pyenv

Published on

Updated on

I enjoy both managing my Python versions with pyenv and the literate programming environment Jupyter lab. Luckily we can easily manage Python virtual environments via iPython kernels.

We’re going to start off with our base Python interpretor

pyenv install 3.8.4
pyenv shell 3.8.4

Then we’re going to install the ipykernel package.

pip install --upgrade pip
pip install ipykernel

Next we’re going to create a virtual environment where JupyterLab will live.

pyenv virtualenv jupyter
pyenv activate jupyter
pip install jupyterlab

With that, we can now create arbitrary environments and add them as a kernel.

pyenv deactivate
pyenv virtualenv tensorflow
pyenv activate tensorflow
pip install tensorflow
ipython kernel install --user --name tensorflow
Reply via Email

Have you published a response to this? :