Ipython Notebook - ImportError:tornado

时间:2015-04-29 02:55:24

标签: ipython tornado

我已经使用

更新了龙卷风

sudo pip install --upgrade tornado

检查当前版本显示我的版本已经超过4.0

找到命令的输出:

pip show tornado | grep版本

Metadata-Version: 1.1
Version: 4.1

任何想法为什么Ipython笔记本无法正常工作,并不断给我一个消息,我没有龙卷风v4.1,而是有3.0版本?谢谢和问候。

=============================================== ========================== $ ipython notebook

Traceback (most recent call last):
  File "/usr/local/bin/ipython", line 11, in <module>
    sys.exit(start_ipython())
  File "/usr/local/lib/python2.7/dist-packages/IPython/__init__.py", line 120, in start_ipython
    return launch_new_instance(argv=argv, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/IPython/config/application.py", line 573, in launch_instance
    app.initialize(argv)
  File "<string>", line 2, in initialize
  File "/usr/local/lib/python2.7/dist-packages/IPython/config/application.py", line 75, in catch_config_error
    return method(app, *args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/IPython/terminal/ipapp.py", line 321, in initialize
    super(TerminalIPythonApp, self).initialize(argv)
  File "<string>", line 2, in initialize
  File "/usr/local/lib/python2.7/dist-packages/IPython/config/application.py", line 75, in catch_config_error
    return method(app, *args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/IPython/core/application.py", line 369, in initialize
    self.parse_command_line(argv)
  File "/usr/local/lib/python2.7/dist-packages/IPython/terminal/ipapp.py", line 316, in parse_command_line
    return super(TerminalIPythonApp, self).parse_command_line(argv)
  File "<string>", line 2, in parse_command_line
  File "/usr/local/lib/python2.7/dist-packages/IPython/config/application.py", line 75, in catch_config_error
    return method(app, *args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/IPython/config/application.py", line 471, in parse_command_line
    return self.initialize_subcommand(subc, subargv)
  File "<string>", line 2, in initialize_subcommand
  File "/usr/local/lib/python2.7/dist-packages/IPython/config/application.py", line 75, in catch_config_error
    return method(app, *args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/IPython/config/application.py", line 402, in initialize_subcommand
    subapp = import_item(subapp)
  File "/usr/local/lib/python2.7/dist-packages/IPython/utils/importstring.py", line 42, in import_item
    module = __import__(package, fromlist=[obj])
  File "/usr/local/lib/python2.7/dist-packages/IPython/html/notebookapp.py", line 50, in <module>
    raise ImportError(msg + ", but you have %s" % tornado.version)
ImportError: The IPython Notebook requires tornado >= 4.0, but you have 3.2

5 个答案:

答案 0 :(得分:7)

我还有一个有冲突的龙卷风副本(ubuntu 14.04上的3.1.1)。要查看是否属于这种情况,请在终端中使用命令:

apt-cache policy python-tornado

打印出操作系统的版本。如果它不是您想要的版本,请使用:

sudo apt-get remove python-tornado

删除它。如果您已使用pip安装了较新版本,则该版本现在将对python可见。

答案 1 :(得分:0)

也许有许多pip和许多Python。检查你的点子版本

pip --version

(我的回复)来自/usr/lib/python2.7/dist-packages(python 2.7)的pip 1.5.4

并检查你的IPython环境:

~$ ipython3
Python 3.4.0 (default, Apr 11 2014, 13:05:11) 
Type "copyright", "credits" or "license" for more information.

IPython 1.2.1 -- An enhanced Interactive Python.

如果environ版本相同。尝试在virtualenv上制作新的环境

答案 2 :(得分:0)

我注意到我的系统上安装了两个Tornado软件包(Ubuntu 14.04)。 Tornado 4.1版本和Tornado 3.2版本在不同的文件夹下。为了解决这个问题,我将包含旧Tornado的文件夹重命名为&#34; Tornado-OLD&#34;。 现在Ipython Notebook能够找到合适的Tornado并在浏览器上打开。

我不确定如何同时安装2个版本的Torando。但如果你有问题,这可能对你有帮助。

感谢您的贡献。 问候 古斯塔沃

答案 3 :(得分:0)

也许你可以试试:

sudo apt-get remove tornado
sudo pip uninstall tornado
sudo pip install tornado

答案 4 :(得分:0)

以下对我有用:

删除龙卷风:

sudo apt-get remove python-tornado

重新安装龙卷风:

sudo pip install tornado

升级龙卷风:

sudo pip install tornado --upgrade