问题
I have installed jupyter and when trying to start it, I get the following error:
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. This actually used to work pretty well but it recently began throw the above error at me. Any help is greatly appreciated.
回答1:
I just solve this problem by force reinstall tornado, using this command:
pip2 install tornado --user --ignore-installed
回答2:
Reinstalling tornado isn’t the problem; the outdated version is. Upgrade with pip install --upgrade tornado.
回答3:
I had this problem on linux and the cause of my grief was permissions related.
ie. jupyter notebook gave me this error.
sudo jupyter notebook worked.
Turned out some libs were owned by root. I must have done a sudo pip something at some stage.
The fix is to either run it as root or change the permissions on the libraries
I did a $ sudo chmod -R o+rx /usr/local/lib/python2.7
来源:https://stackoverflow.com/questions/42265338/jupyter-notebook-importerror-no-module-named-tornado-log