The traceback is clear:
You must install pyzmq
pyzmq is a requirement for the ipython notebook.
For a list of dependencies check this
题
I am using a windows 8 64 bit laptop. I already have python 2.7 on my pc. So I installed Ipython using the easy_install. I can now see an ipython application file in C:\Python27\Scripts. When I run that file it opens up my cmd and I can write code. However when I say Ipython notebook
in the cmd under the same folder it does not open up the notebook in a browser and gives the following error -
C:\Users\UserName>cd C:\Python27\Scripts\
C:\Python27\Scripts>Ipython notebook
Traceback (most recent call last):
File "C:\Python27\Scripts\ipython-script.py", line 9, in <module>
load_entry_point('ipython==1.2.0', 'console_scripts', 'ipython')()
File "C:\Python27\lib\site-packages\ipython-1.2.0-py2.7.egg\IPython\__init__.p
y", line 118, in start_ipython
return launch_new_instance(argv=argv, **kwargs)
File "C:\Python27\lib\site-packages\ipython-1.2.0-py2.7.egg\IPython\config\app
lication.py", line 544, in launch_instance
app.initialize(argv)
File "<string>", line 2, in initialize
File "C:\Python27\lib\site-packages\ipython-1.2.0-py2.7.egg\IPython\config\app
lication.py", line 89, in catch_config_error
return method(app, *args, **kwargs)
File "C:\Python27\lib\site-packages\ipython-1.2.0-py2.7.egg\IPython\terminal\i
papp.py", line 312, in initialize
super(TerminalIPythonApp, self).initialize(argv)
File "<string>", line 2, in initialize
File "C:\Python27\lib\site-packages\ipython-1.2.0-py2.7.egg\IPython\config\app
lication.py", line 89, in catch_config_error
return method(app, *args, **kwargs)
File "C:\Python27\lib\site-packages\ipython-1.2.0-py2.7.egg\IPython\core\appli
cation.py", line 373, in initialize
self.parse_command_line(argv)
File "C:\Python27\lib\site-packages\ipython-1.2.0-py2.7.egg\IPython\terminal\i
papp.py", line 307, in parse_command_line
return super(TerminalIPythonApp, self).parse_command_line(argv)
File "<string>", line 2, in parse_command_line
File "C:\Python27\lib\site-packages\ipython-1.2.0-py2.7.egg\IPython\config\app
lication.py", line 89, in catch_config_error
return method(app, *args, **kwargs)
File "C:\Python27\lib\site-packages\ipython-1.2.0-py2.7.egg\IPython\config\app
lication.py", line 474, in parse_command_line
return self.initialize_subcommand(subc, subargv)
File "<string>", line 2, in initialize_subcommand
File "C:\Python27\lib\site-packages\ipython-1.2.0-py2.7.egg\IPython\config\app
lication.py", line 89, in catch_config_error
return method(app, *args, **kwargs)
File "C:\Python27\lib\site-packages\ipython-1.2.0-py2.7.egg\IPython\config\app
lication.py", line 405, in initialize_subcommand
subapp = import_item(subapp)
File "C:\Python27\lib\site-packages\ipython-1.2.0-py2.7.egg\IPython\utils\impo
rtstring.py", line 42, in import_item
module = __import__(package, fromlist=[obj])
File "C:\Python27\lib\site-packages\ipython-1.2.0-py2.7.egg\IPython\html\noteb
ookapp.py", line 36, in <module>
check_for_zmq('2.1.11', 'IPython.html')
File "C:\Python27\lib\site-packages\ipython-1.2.0-py2.7.egg\IPython\utils\zmqr
elated.py", line 37, in check_for_zmq
raise ImportError("%s requires pyzmq >= %s"%(required_by, minimum_version))
ImportError: IPython.html requires pyzmq >= 2.1.11
C:\Python27\Scripts>
解决方案 2
The traceback is clear:
You must install pyzmq
pyzmq is a requirement for the ipython notebook.
For a list of dependencies check this
其他提示
make sure pyzmq is installed in the same virtualenvironment (or lack of) as ipython. For me, ipython notebook was installed as regular, but its dependencies got put in my virtualenvironment. A quick install in the proper place fixed this error for me.
I'm putting this solution here because the error message is the same though the scenario is different from the original poster's, I think.
I am running iPython notebook in a virtual environment on a virtual box. I think the virtual box bit is irrelevant, but the virtualenvironment is not. I installed ipython[notebook] via pip in the virtualenvironment and got the same error ImportError: IPython.html requires pyzmq >= 2.1.11
But, I could plainly see that pyzmq was installed. Both pip freeze
and pip install --upgrade pyzmq
showed that I had the latest pyzmq version available and it was definitely >= 2.1.11 (pip freeze|grep pyzmq
gives pyzmq==14.3.1
).
I exited the virtualenvironment and checked pyzmq again and discovered that pyzmq was installed only in the virtualenv. That should be the way it's supposed to work, but for some reason ipython was looking in the main python location, not the virtualenv's python location. I suspect that ipython was installed outside the virtualenvironment. I don't know why pyzmq was installed only inside it. Anyhow, pip install pyzmq
while outside my virtualenvironment fixed everything and now it all works. Sorry for the verbose answer.
The iPython install documentation says:
[...] you can get IPython with pip:
pip install ipython
Or if you want to also get the dependencies for the IPython notebook:
pip install "ipython[notebook]"