Set up virtual environment and link it to the jupyter notebook - sheikirfanbasha/kaggle GitHub Wiki

Steps to make jupyter notebook run with the virual env.

1. Create the virtual environment

conda create -n <env_name> python=3.6

2. Install the kernel that uses the virtual env

conda install ipykernel --name <env_name> --display-name <user_friendly_env_name>

3. Start the jupyter notebook

jupyter notebook

4. Choose the kernel from the UI

Test

import sys
print(sys.executable)

FAQ

1. I have installed a new package in the virtual environment. But, it is showing module not found error in the notebook. What should I do?

  • In most of the cases, just restarting the kernel in the jupyter notebook shall fix the issue. If the problem still persist, then try unistalling the package that is not being loaded and check its installed location. If the location is not inside the virtual env. try unistalling completely and install fresh.
⚠️ **GitHub.com Fallback** ⚠️