Python版本和Jupyter Notebook的问题

2024-04-25 04:47:52 发布

您现在位置:Python中文网/ 问答频道 /正文

所以我使用anaconda创建了一个python 2.7 env“gdsenv”:

enter image description here

然后我安装了jupyter内核:

enter image description here

…到目前为止还不错。你知道吗

问题是,如果我打开jupyter笔记本,就没有python 2.7选项(我在另一个env上安装了python 3.5):

enter image description here

为什么会这样?我该怎么解决?


Tags: env选项笔记本jupyteranaconda内核gdsenv
1条回答
网友
1楼 · 发布于 2024-04-25 04:47:52

看看你能不能install an ipython kernel for python2。你知道吗

我没有安装anaconda,但下面是它如何在用python2 -m virtualenv jupyter-test创建的虚拟环境中工作的:

  1. 安装jupyter:
    python2 -m pip install jupyter
  2. 为python2安装ipython内核:
    python2 -m pip install ipykernel
    python2 -m ipykernel install user
  3. 开始jupyter而不是[![电子书
    jupyter notebook][1]][1]

现在您应该可以创建python2内核了:

Python 2 Notebook

另请参见似乎相关的问题: Using both Python 2.x and Python 3.x in IPython Notebook。你知道吗

相关问题 更多 >