Thomas Dehaeze Thomas Dehaeze - 8 months ago 86
Python Question

Link Conda environment with Jupyter Notebook

I'm trying to set a good environnement for doing some scientific stuff with python. To do so, I installed Jupyter & miniconda.

Then I want to be able to have different environnement and use them with Jupyter notebooks. So I created two custom envs with conda : py27 and py35.

> conda env list
# conda environments:
py27 /Users/***/miniconda3/envs/py27
py35 /Users/***/miniconda3/envs/py35
root * /Users/***/miniconda3

Then on my notebook I have two kernels
python 2
python 3
Inside a notebook, I get the following with the python3 kernel :

> import sys
> print(sys.executable)

And this with the python2 kernel :

> import sys
> print(sys.executable)

  • How can I set the
    to miniconda env for python2 ?

  • How can I bind a conda env with a notebook kernel ?

  • Is doing
    source activate py35
    has a link with
    jupyter notebook

I think I really missed something.

Thank you everyone.

--- edit

I have multiple jupyter bin :

> where jupyter

I have only one kernel here
But inside Jupyter, I have two kernels,
. Where can I find the other one ?

I modified

"display_name": "Python 2",
"language": "python",
"argv": [

And then :

import sys

So nothing has changed


I found the solution. The setup for the kernels where located here ~/Library/Jupyter/kernels/.

Then I modified the kernel.json file and set the right path to python.

Now it's working.