Anaconda Jupyter笔记本内核问题 [英] Anaconda Jupyter Notebooks Kernel Problems

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

问题描述

TL,DR:如何让我的机器/anaconda忘记python 3.7的存在,以便我可以在python 3.6上运行所有内容?

TL,DR: How can I make my machine/anaconda forget that python 3.7 exists so that I can run everything on python 3.6?

我已将整个故事以列表格式列出,以使其更易于阅读.

I've put the full story in a list format to make this easier to read.

1)我在Python 2.7中有一个工作正常的BagOfWords. Jupyter Notebooks运行得很好.

1) I have a working BagOfWords in Python 2.7. It was running just fine with Jupyter Notebooks.

2)我想使用一个称为Newspaper的python库,但是它在python 3而不是python 2中效果最好.

2) I wanted to use a python library called Newspaper, but it works best in python 3 instead of python 2.

3)我下载了python 3.7,以便报纸可以运行.

3) I download python 3.7 so Newspaper can run.

4)报纸可以在Python 3.7上很好地运行,但是尚未运行另一个模块tensorflow,这对于运行BagofWords是必不可少的,

4) Newspaper works great with Python 3.7, but another module, tensorflow, which is necessary for the BagofWords to run, is not yet updated to work with Python 3.7

5)我下载了可与tensorflow配合使用的Python 3.6.

5) I download Python 3.6, which works with tensorflow.

6)我从计算机上删除了Python 3.7.

6) I delete Python 3.7 off my machine.

7)我现在尝试使用python 3.6重新打开我的工作,以便tensorflow可以工作. Jupyter Notebook打开,但提示我选择要使用的内核.我选择Python 3,但收到以下错误消息:启动内核时出错FileNotFoundError:[Errno 2]没有这样的文件或目录:'/Library/Frameworks/Python.framework/Versions/3.7/bin/python3':

7) I try to reopen my work now using python 3.6 so tensorflow can work. Jupyter Notebook opens, but prompts me to select which kernel to use. I select Python 3, but I recieve this error message: Error Starting Kernel FileNotFoundError: [Errno 2] No such file or directory: '/Library/Frameworks/Python.framework/Versions/3.7/bin/python3':

8)我知道它正在尝试通过不再存在的路径(python 3.7路径)查找内容.我删除并重新安装了anaconda,希望它会忘记此旧路径(和python 3.7),以便我可以使用Python 3.6.这没用.

8) I know that it is trying to find things though a path that no longer exists (the python 3.7 path). I delete and reinstall anaconda in the hopes that it will forget this old path (and python 3.7) so that I can work with Python 3.6. It does not work.

问题:如何让我的机器/anaconda忘记python 3.7的存在,以便可以在python 3.6上运行所有内容?这是我第一次使用jupyter笔记本,因此我一直在寻找答案,但是其中许多对我来说都没有意义.我正在研究运行MacOs Mojave 10.14.1的2015 Macbook Pro

question: How can I make my machine/anaconda forget that python 3.7 exists so that I can run everything on python 3.6? This is my first time working with jupyter notebooks, so I have searched for answers but many of them did not make sense to me. I am working on a 2015 Macbook Pro that is running MacOs Mojave 10.14.1

更新:即使尝试使用conda的新环境也不起作用.最终,我放弃了所有代码,并将其移至google colab,虽然我不怎么喜欢它,但至少它确实有效....

Update: even trying new environments with conda didn't work. I eventually gave up and moved all my code to google colab, which I'm not a huge fan of, but at least it actually works....

推荐答案

我建议您使用所需的特定python版本(如果要使用tensorflow,则为3.6)创建一个新环境.

I would suggest that you just a create a new environment with the specific python version you want (3.6 in your case if you want to use tensorflow)

conda create -n yourenvname python=3.6 anaconda

创建环境后,将其激活:

After creating the environment, activate it:

source activate yourenvname (if on Windows, then: conda activate yourenvname)

现在您有了一个全新的环境,您可以开始仅安装所需的软件包-tensorflow,开始使用pip.

Now that you have a balnk new environment you can start installing only the needed packages - tensorflow to begin with using pip.

在此特定环境中需要的任何其他软件包,只要激活该环境,也可以使用pip或conda install进行安装.

Any other package you need in this specific environment you can install also using pip or conda install as long as the environment is activated.

请记住,如果要对其他项目使用其他版本或其他软件包,则需要停用环境.

Keep in mind though that you need to deactivate the environment if you want to use other versions or other packages for other projects.

希望这会有所帮助.

这篇关于Anaconda Jupyter笔记本内核问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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