在virtualenv中设置ipython notebook

时间:2013-08-01 10:54:30

标签: virtualenv ipython importerror ipython-notebook pyzmq

我使用的是Ubuntu 12.04 LTS。我已经尝试了很多次从virtualenv运行ipython笔记本。它不起作用,出现以下错误消息:

    (ipython-notebook)gias@~/dev/virtualenvs/ipython-notebook$ ipython notebook
Traceback (most recent call last):
  File "/dev/virtualenvs/ipython-notebook/bin/ipython", line 8, in <module>
    load_entry_point('ipython==0.13.2', 'console_scripts', 'ipython')()
  File "/dev/virtualenvs/ipython-notebook/local/lib/python2.7/site-packages/IPython/frontend/terminal/ipapp.py", line 388, in launch_new_instance
    app.initialize()
  File "<string>", line 2, in initialize
  File "/dev/virtualenvs/ipython-notebook/local/lib/python2.7/site-packages/IPython/config/application.py", line 84, in catch_config_error
    return method(app, *args, **kwargs)
  File "/dev/virtualenvs/ipython-notebook/local/lib/python2.7/site-packages/IPython/frontend/terminal/ipapp.py", line 313, in initialize
    super(TerminalIPythonApp, self).initialize(argv)
  File "<string>", line 2, in initialize
  File "/dev/virtualenvs/ipython-notebook/local/lib/python2.7/site-packages/IPython/config/application.py", line 84, in catch_config_error
    return method(app, *args, **kwargs)
  File "/dev/virtualenvs/ipython-notebook/local/lib/python2.7/site-packages/IPython/core/application.py", line 325, in initialize
    self.parse_command_line(argv)
  File "/dev/virtualenvs/ipython-notebook/local/lib/python2.7/site-packages/IPython/frontend/terminal/ipapp.py", line 308, in parse_command_line
    return super(TerminalIPythonApp, self).parse_command_line(argv)
  File "<string>", line 2, in parse_command_line
  File "/dev/virtualenvs/ipython-notebook/local/lib/python2.7/site-packages/IPython/config/application.py", line 84, in catch_config_error
    return method(app, *args, **kwargs)
  File "/dev/virtualenvs/ipython-notebook/local/lib/python2.7/site-packages/IPython/config/application.py", line 420, in parse_command_line
    return self.initialize_subcommand(subc, subargv)
  File "<string>", line 2, in initialize_subcommand
  File "/dev/virtualenvs/ipython-notebook/local/lib/python2.7/site-packages/IPython/config/application.py", line 84, in catch_config_error
    return method(app, *args, **kwargs)
  File "/dev/virtualenvs/ipython-notebook/local/lib/python2.7/site-packages/IPython/config/application.py", line 352, in initialize_subcommand
    subapp = import_item(subapp)
  File "/dev/virtualenvs/ipython-notebook/local/lib/python2.7/site-packages/IPython/utils/importstring.py", line 40, in import_item
    module = __import__(package,fromlist=[obj])
  File "/dev/virtualenvs/ipython-notebook/local/lib/python2.7/site-packages/IPython/frontend/html/notebook/__init__.py", line 18, in <module>
    from IPython.zmq import check_for_zmq
  File "/virtualenvs/ipython-notebook/local/lib/python2.7/site-packages/IPython/zmq/__init__.py", line 67, in <module>
    check_for_zmq('2.1.4')
  File "/dev/virtualenvs/ipython-notebook/local/lib/python2.7/site-packages/IPython/zmq/__init__.py", line 53, in check_for_zmq
    raise ImportError("%s requires pyzmq >= %s"%(module, minimum_version))
ImportError: IPython.zmq requires pyzmq >= 2.1.4

这是当前的安装状态:

(ipython-notebook)gias@~/dev/virtualenvs/ipython-notebook$ pip freeze
argparse==1.2.1
ipython==0.13.2
nose==1.3.0
pyzmq==13.1.0
tornado==3.1
wsgiref==0.1.2

我做错了吗?

1 个答案:

答案 0 :(得分:2)

import zmq适合您吗?看起来您没有安装libzmq