无法在Jupyter笔记本中获得python3 [英] Cannot get python3 in Jupyter notebook

查看:530
本文介绍了无法在Jupyter笔记本中获得python3的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何让python3在Jupyter中运行?我也无法让它提供该内核。
当我在终端上运行 ipython3 notebook 时,我检查了Python的版本:

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)

我在哪里得到输出:

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

当我运行 jupyter notebook ,我只能选择新的 python 2 笔记本和

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

import sys
print(sys.version)

我得到输出:

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

我尝试运行:

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


推荐答案

我也有这个问题,但通过使用Python3作为Python二进制文件制作virtualenv来解决它;安装iPython;并从virtualenv推出了iPython笔记本。我将测试以查看相同的过程是否适用于Jupyter(我希望它会)。请注意,当我这样做时,我只能选择制作Python 3笔记本。

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.

以下步骤对我有用:

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

弹出一个网页,我被允许制作一个Python 3笔记本。

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

这篇关于无法在Jupyter笔记本中获得python3的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆