Can't install PyZMP for Python -- Dependencies
Asked Answered
H

2

1

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.
Heaviness answered 2/4, 2014 at 15:7 Comment(0)
F
2

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/

Ferricyanide answered 2/4, 2014 at 16:29 Comment(1)
mm, for some reason some packages that required pyzmq as a dependency were still crashing with an import error, but restarting the terminal seemed to have fixed it. I guess I had successfully installedHeaviness
E
1

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]"
Especially answered 20/4, 2015 at 19:8 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.