You want to activate a virtual environment when running a Jupyter notebook using Python. In
a terminal create a virtual environment, e.g., virtualenv --python=python3.6 .venv
, then source
that environment. Besides installing any required package and Jupyter (pip install --upgrade jupter
) you need to install ipykernel
, the IPython backend:
pip install ipykernel
python -m ipykernel install --user --name=.venv
Next launch Jupyter. In the upper right corner go to Kernel -> Change Kernel. You should see .venv
in the drop down. Select it, restart the kernel, et voila...