Adding Virtual Environment to Jupyter Notebook
Adding a new virtual environment to Jupyter Notebook
After we create a virtual environment, we need to add the created virtual environment to Jupyter notebook.
- Make sure you have activated the virtual environment and execute below code:
pip install --user ipykernel
- Manually add the kernel / virtual environment to the Jupyter notebook:
python -m ipykernel install --user --name=NewVirtualEnvironment
- Close the command prompt and open jupyter notebook:
jupyter notebook
-
Select the “New” dropdown and you should be able to find newly created virtual environment.
- Uninstalling: If you need to uninstall the kernel, we can use below command:
jupyter kernelspec uninstall VirtualEnvironment