如何在jupyter上将python 3.6内核与3.5一起添加 [英] How to add python 3.6 kernel alongside 3.5 on jupyter
问题描述
我正在尝试在Python 3.6上测试一些代码,但是我的系统默认python版本是python 3.5.我已经安装了python 3.6,并尝试按照jupyter文档安装新的python内核
I am trying to test some code on Python 3.6 but my system default python version is python 3.5 I have installed python 3.6 and have tried to follow the jupyter documentation to install a new python kernel
python3.6 -m pip install ipykernel
python3.6 -m ipykernel install --user
但是它没有用,因为它继续在菜单中显示单个内核:Python3
But it didn't work since it continues to show a single kernel in the menu: Python3
有人在同一jupyter安装中设法同时拥有3.5和3.6吗?
Has anyone managed to have both 3.5 and 3.6 in the same jupyter installation?
推荐答案
一个选项是创建一个可在jupyter笔记本中使用的内核.
one option is to create a kernel that you can use in jupyter notebook.
您可以在虚拟环境中执行此操作:
you can do this inside the virtual environment:
-
打开您的终端,然后逐行输入以下内容
Open up your terminal and enter the following line by line
virtualenv -p python3.6 py_36_env
source py_36_env/bin/activate
pip install ipykernel
python -m ipykernel install --user --name=py_36_env
jupyter notebook
然后在jupyter笔记本中,您可以从上方显示的'New'下拉菜单中或给定的jupyter笔记本中的'Kernel'下拉菜单中选择3.6环境(py_36_env
).
Then in jupyter notebook you can select the 3.6 environment (py_36_env
) from the 'New' drop down menu shown above or from the 'Kernel' drop down menu within a given jupyter notebook.
这篇关于如何在jupyter上将python 3.6内核与3.5一起添加的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!