简体   繁体   English

Jupyter 笔记本导入错误:没有名为 tornado.log 的模块

[英]Jupyter notebook ImportError: No module named tornado.log

I have installed jupyter and when trying to start it, I get the following error:我已经安装了 jupyter,在尝试启动它时,出现以下错误:

File "/Library/Frameworks/Python.framework/Versions/2.7/bin/jupyter-notebook", line 7, in <module>
from notebook.notebookapp import main
File"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/notebook/__init__.py", line 25, in <module>
from .nbextensions import install_nbextension
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/notebook/nbextensions.py", line 35, in <module>
from tornado.log import LogFormatter
ImportError: No module named tornado.log

I tried uninstalling and reinstalling jupyter, tornado, or anything I could somehow link to this error and nothing really helped.我尝试卸载并重新安装 jupyter、tornado 或任何我可以以某种方式链接到此错误的东西,但没有任何帮助。 This actually used to work pretty well but it recently began throw the above error at me.这实际上过去工作得很好,但最近开始向我抛出上述错误。 Any help is greatly appreciated.任何帮助是极大的赞赏。

我只是通过强制重新安装 tornado 来解决这个问题,使用这个命令: pip2 install tornado --user --ignore-installed

Reinstalling tornado isn't the problem;重新安装 Tornado 不是问题; the outdated version is.过时的版本是。 Upgrade with pip install --upgrade tornado .使用pip install --upgrade tornado升级。

I had this problem on linux and the cause of my grief was permissions related.我在 linux 上遇到了这个问题,我悲痛的原因与权限有关。

ie. IE。 jupyter notebook gave me this error. jupyter notebook 给了我这个错误。

sudo jupyter notebook worked. sudo jupyter 笔记本工作。

Turned out some libs were owned by root.原来一些库是由 root 拥有的。 I must have done a sudo pip something at some stage.我一定在某个阶段做了一个 sudo pip 的事情。

The fix is to either run it as root or change the permissions on the libraries修复方法是以 root 身份运行它或更改库的权限

I did a $ sudo chmod -R o+rx /usr/local/lib/python2.7我做了一个 $ sudo chmod -R o+rx /usr/local/lib/python2.7

Try this:尝试这个:

pip install --upgrade tornado

It worked for me.它对我有用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM