在jupyter中选择python内核 [英] choose python kernel in jupyter

查看:963
本文介绍了在jupyter中选择python内核的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经安装在Debian Jessie上:



Python2.7



Python3.5



我还通过 pip2 pip3

安装Jupyter

但是当我启动 jupyter-notebook 我只能使用python3作为内核!我使用Jupyter如何切换到pyhton2.7?

解决方案

我在数字海洋中使用了一台新的Debian 8.5机器。



以root身份,从apt安装 pip jupyter ,和开发包也是。

  apt-get install python-py python-dev python3-pip python3-dev libzmq3 
pip3安装jupyter

使用 ipykernel添加Python2的内核, / code>模块。已经安装了Python3内核。

  pip install ipykernel 
python2 -m ipykernel install

当您运行 jupyter笔记本时,您应该同时拥有 Python 2 Python 3 列为可用内核。请注意,Tornado笔记本电脑服务器正在端口8888上提供HTTP,在许多机器上默认情况下不会打开。以下是


I have installed on Debian Jessie:

Python2.7

Python3.5

I have also installed Jupyter via pip2 and pip3

However when I launch jupyter-notebook I can only use python3 as kernel! How can I switch to pyhton2.7 when using Jupyter?

解决方案

I tried this with a fresh Debian 8.5 machine on Digital Ocean.

As root, install pip and jupyter from apt, and the development packages, too.

apt-get install python-pip python-dev python3-pip python3-dev libzmq3
pip3 install jupyter

Add the kernel for Python2 using the ipykernel module. The Python3 kernel is installed, already.

pip install ipykernel
python2 -m ipykernel install

When you run jupyter notebook, you should have both Python 2 and Python 3 listed as available kernels. Notice that the Tornado notebook server is serving HTTP on port 8888, which isn't opened by default on many machines. Here is a script that will run Jupyter for you, opening and closing port 8888 and running on a public IP.

这篇关于在jupyter中选择python内核的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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