Use virtualenv with a Python Jupyter notebook
Using a virtual environment with a Jupyter notebook is easy!
Install and use virtualenv
For instructions on installing, using, and activating virtualenv, refer to my blog article here.
NOTE: You may use your virtual environment of choice.
Add virtualenv environment to Jupyter notebook
- Activate the virtual environment
- Install
ipykernel
1pip3 install ipykernel- Use the
ipykernel installcommand
1python3 -m ipykernel install --user --name=venv # this name can be anything- Open
jupyter-laband click on the environment labeledvenv
The ipykernel install command uses the current environment when creating the kernel.