I am on OSX Sierra (10.12.5), and am using Jupyter Notebook v 4.3.0. I have installed both Python2 and Python3 using Homebrew, and both kernels for Jupyter Notebook. Upon opening the notebook to use Python3 kernel, I find that it still uses Python2.
I might be missing something obvious in my installation, but I can't seem to figure out what it is.
I installed both Python2 and Python3 using Homebrew, and Jupyter Notebook on my system thus:
I ran all analogous commands for Python2 as well.
I generated the config file using
Both kernels installed:
Both kernels seem to be visible to kernelspec:
As an additional check,
When I opened a new notebook using Python3 kernel, none of the packages I installed using
When I run
It doesn't seem to be the biggest deal breaker, as I can continue working with
Yup, it's the same. Running
I didn't fully understand what @minrk said above, but running
As @takluyver suggested, changing
My jupyter notebook was using a python3 kernel even though I wanted it to use a python2 kernel (and the web interface was showing python2).
I'm having a similar issue on Mac OS. When trying to run the kernel within a virtual environment, the system python (brew installed) is loaded instead.
When the virtualenv is active:
The kernel.json file reads:
Changing the kernel.json path manually to the venv path does not fix the issue. When running a notebook, sys.executable still returns:
as reported by others,
but from within jupyter lab,
so far, 2 solutions have been proposed, neither of which worked for me: