Example of how to use a given python conda environment in a Jupyter notebook.
Create a conda environment
To install conda go to Anaconda Individual Edition . Since conda is installed in your system to create an environment (called for example hereafter worklab) use the following command:
conda create --name worklab
and then enter
source activate worklab
to activate the environment called worklab.
Note: to get a list of your environment, there is the command:
conda env list
that returns in my case for example:
# conda environments:
worklab * /Users/mb/anaconda3/envs/worklab
Use a conda environment in a Jupyter notebook
To use for example the environment worklab that we just created in a Jupyter notebook , a solution is to use ipykernel. Enter the following command:
conda install -c anaconda ipykernel
python -m ipykernel install --user --name=worklab
Now run a Jupyter notebook on your local machine using:
Then, to select the conda environment. use the dropdown menu on the right (see figure below)
or go in the menu 'kernel':
|Anaconda Individual Edition
|How to add your Conda environment to your jupyter notebook in just 4 steps
|In which conda environment is Jupyter executing?
|Conda environments not showing up in Jupyter Notebook