Cannot get python3 in Jupyter notebook

北慕城南 提交于 2019-12-07 01:52:33

问题


How can I get python3 to run in Jupyter? I cannot get it to supply that kernel as well. When I run ipython3 notebook at the terminal, I check the version of Python:

import sys
print(sys.version)

where I get the output:

3.4.0 (default, Jun 19 2015, 14:20:21) 
[GCC 4.8.2]

When I run jupyter notebook, I have only the option of a new python 2 notebook and

import sys
print(sys.version)

where I get the output:

2.7.6 (default, Jun 22 2015, 17:58:13) 
[GCC 4.8.2]

I try to run:

sudo ipython3 kernelspec install-self
[TerminalIPythonApp] WARNING | File not found: 'kernelspec'

回答1:


I had this same problem, but solved it by making a virtualenv using Python3 as the Python binary; installed iPython; and launched iPython notebook from virtualenv. I will test to see if the same procedure works with Jupyter (I expect that it will). Note that when I did this, I only had the option of making Python 3 notebooks.

The following steps worked for me:

mkvirtualenv --python=/full/path/to/python3.5 p35
pip install jupyter
jupyter notebook

A web page popped up and I was allowed to make a Python 3 notebook.



来源:https://stackoverflow.com/questions/32102200/cannot-get-python3-in-jupyter-notebook

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!