My Jupyter
notebooks installed with python 2
kernel. I do not understand why. I might have messed something up when I did the install. I already have python 3
installed. How can I add it to Jupyter
?
Here's a screenshot of what the default Jupyter
insalled with python3 -m install jupyter
and opened in the browser with jupyter notebook
looks like:
相关问题
- Access IPython's profile history (history.sqli
- Requests.get showing different HTML than Chrome
- tf.enable_eager_execution must be called at progra
- ipywidgets widgets values not changing
- Pandas and NumPy default width change on startup
相关文章
- cython in jupyter notebook
- python: ignoring leading “>>>” and “…” in interact
- Pyspark error: Java gateway process exited before
- Vim key map in jupyter notebook
- how to print source code of object I defined use
- IPython won't start
- How can the terminal in Jupyter automatically run
- Jupyter Notebook doesn't show new environments
Make sure you have
ipykernel
installed and useipython kernel install
to drop the kernelspec in the right location for python2. Thenipython3 kernel install
for Python3. Now you should be able to chose between the 2 kernels regardless of whether you usejupyter notebook
,ipython notebook
oripython3 notebook
(the later two are deprecated).Note that if you want to install for a specific Python executable you can use the following trick:
This works when using environments (venv,conda,...) and the
<options>
let you name your kernel (see--help
). So you can doAnd now you get a kernel named
py36-test
in your dropdown menus, along the other ones.See Using both Python 2.x and Python 3.x in IPython Notebook which has more recent information.
When you use conda managing your python envs, follow these two steps:
activate py3
(on Windows orsource activate py3
on Linux)conda install notebook ipykernel
or just useconda install jupyter
Following command works for me, on macOS Sierra(10.12.3)
check it with jupyter kernelspec list Available kernels: python3 /Users/admin/Library/Jupyter/kernels/python3 python2 /anaconda2/share/jupyter/kernels/python2
On Ubuntu 14.04 I had to use a combination of previous answers.
First, install
pip3
apt-get install python-pip3
Then with
pip3
install jupyterpip3 install jupyter
Then using
ipython3
install the kernelipython3 kernel install
The solution is well documented in the official docs: https://ipython.readthedocs.org/en/latest/install/kernel_install.html
I tried the first approach. Since I already had
ipykernel
installed, simply runningpython3 -m ipykernel install --user
solved the problem.I managed to install a Python3 kernel besides the Python2. Here is the way I did it:
The latest working link can be found here.
The actual code is: