本文翻译自:Conda environments not showing up in Jupyter Notebook
I installed Anaconda (with Python 2.7), and installed Tensorflow in an environment called tensorflow
. 我安装了Anaconda(使用Python 2.7),并在名为tensorflow
的环境中安装了tensorflow
。 I can import Tensorflow successfully in that environment. 我可以在该环境中成功导入Tensorflow。
The problem is that Jupyter Notebook does not recognize the new environment I just created. 问题在于Jupyter Notebook无法识别我刚刚创建的新环境。 No matter I start Jupyter Notebook from the GUI Navigator or from the command line within the tensorflow
env, there is only one kernel in the menu called Python [Root]
, and Tensorflow cannot be imported. 无论我从GUI导航还是从内部的命令行启动Jupyter笔记本tensorflow
ENV,只有一个名为菜单内核Python [Root]
,并且Tensorflow无法导入。 Of course, I clicked on that option multiple times, saved file, re-opened, but these did not help. 当然,我多次单击该选项,保存了文件,然后重新打开,但是这些无济于事。
Strangely, I can see the two environments when I open the Conda
tab on the front page of Jupyter. 奇怪的是,当我打开Jupyter主页上的Conda
选项卡时,可以看到两种环境。 But when I open the Files
tab, and try to new
a notebook, I still end up with only one kernel. 但是,当我打开Files
选项卡,并尝试new
笔记本,我还是结束了只有一个内核。
I looked at this question: Link Conda environment with Jupyter Notebook But there isn't such a directory as ~/Library/Jupyter/kernels
on my computer! 我看着这个问题: 用Jupyter Notebook链接Conda环境但是我的计算机上没有~/Library/Jupyter/kernels
这样的目录! This Jupyter directory only has one sub-directory called runtime
.</