1. Activate the environment you want to use in the Jupyter Notebook first in VirtualEnv or Anaconda

    source venv/bin/activate
  2. Make sure the Jupyter Notebook is installed in this environment. If not, perform the following installation

    pip install notebook
  3. Once you’ve made sure you have a jupyter notebook in that environment, run the following command (“kernel-name” can be replaced with whatever name you want, put it in double quotes)

    ipython kernel install --name "kernel-name" --user
  4. Then open the Jupyter Notebook and open up any Python file. The new kernel can be found in the “kernel-> Change kernel” section of the menu