问题
I am having trouble installing the PyZMP dependency for iPython. I have tried a number of things such as using pip/brew, but ended up installing the package manually using this answer.
Now, pip list packages
yields the following
pyzmq (14.2.0-dev)
pyzmq-static (2.2)
(I have also tried using pyzmq-static).
Also, my python eggs are clearly present in the proper location:
ls /usr/local/lib/python2.7/site-packages/ | grep "pyzmq"
pyzmq-14.2.0_dev-py2.7.egg-info
pyzmq_static-2.2-py2.7.egg-info
Furthermore:
which python
/usr/local/bin/python
echo $PYTHONPATH
/usr/local/lib/python:
However, when I try to import
Python 2.7.6 (default, Mar 20 2014, 17:55:13)
In [1]: import pyzmq
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-1-2faa556e5dc0> in <module>()
----> 1 import pyzmq
ImportError: No module named pyzmq
Any help troubleshooting would be much apprecaited!
Update: I am able to list the zmq modules in python, but not the pyzmq modules:
>>help('modules zmq')
Here is a list of matching modules. Enter any module name to get more help.
buildutils - utilities for building pyzmq.
buildutils.constants - script for generating files that involve repetitive
updates for zmq constants.
buildutils.detect - Detect zmq version
zmq - Python bindings for 0MQ.
...
zmqversion - A simply script to scrape zmq.h for the zeromq version.
IPython.consoleapp - A minimal application base mixin for all ZMQ based
IPython frontends.
IPython.html.base.zmqhandlers - Tornado handlers for WebSocket <-> ZMQ sockets.
...
IPython.utils.zmqrelated - Utilities for checking zmq versions.
回答1:
You have to use:
import zmq
instead of
import pyzmq
have a look at the official Examples at https://github.com/zeromq/pyzmq/blob/master/examples/
回答2:
I also struggled getting IPython (Jupyter) installed, especially with the pyzmq dependency. In the end, I found a method that worked for me (in Ubuntu) with much less hassle:
$ sudo apt-get install libtool pkg-config build-essential autoconf automake python-dev
$ sudo apt-get build-dep matplotlib
$ sudo pip install matplotlib
$ sudo pip install "ipython[all]"
来源:https://stackoverflow.com/questions/22815673/cant-install-pyzmp-for-python-dependencies