13

How to install Python paackage pyzmq properly?

I searched in Synapic package manager in vain.

5 Answers 5

20
apt-cache search python zmq

returns

python-zmq - Python bindings for 0MQ library
python-zmq-dbg - Python bindings for 0MQ library - debugging files

Is this what you are looking for? Then

apt-get install python-zmq

should work.

For future searches:

Python modules in Debian and Ubuntu are often named differently:

python-<module name> where <module name> often does not contain "py" or "python".

1
  • Really thankful for the solution. I have been banging my head to get this installed! Thanks again!
    – Rafay
    Aug 25, 2014 at 10:35
5

I got an error message like this when I tried to run ipython notebook on ubuntu 12.04

ImportError: IPython.html requires pyzmq >= 13, but you have 2.1.11

I tried

sudo pip uninstall pyzmq
sudo pip install pyzmq

but it didn't work. Finally, I solve the problem by

sudo pip install --upgrade pyzmq
2
sudo apt-get install libzmq-dev
sudo easy_install pyzmq

This installed 2.2.0 version of libzmq-dev. pyzmq complained that it was 3.2.0 and features beyond 2.2.0 could not be used (since its base libzmq was 2.2.0). Tried loading it in python and it gave a whole bunch of errors.

So:

apt-get purge libzmq-dev

and installed libzmq after doing a git clone from the zmq git site. It installed the 3.2.0 version of libzmq just fine. However, trying to then install pyzmq gave errors like "timer_create undefined". One site said, I needed to update my Cython - which I did .. to ver. 19.x. Still same error. So uninstalled libzmq and pyzmq again.

Did a clean install using

sudo apt-get install python-zmq

This did a correct install -- but of an older version of 2.2.0. Ok, so I have something better than nothing, I suppose.

Why does it have to be so damn hard ... grrrrr ... .

1

Consider using easy_install, perhaps in connection with a Python virtual environment. You need to install the libzmq-dev package so that the Python package compiles.

sudo apt-get install libzmq-dev
virtualenv ~/test-ve
source ~/test-ve/bin/activate
easy_install pyzmq

Note the absence of sudo for the easy_install call, this is due to the Python virtual environment. You need to activate the virtualenv before running the Python code, though. For systemwide installation, simply do

sudo apt-get install libzmq-dev
sudo easy_install pyzmq
4
  • What is the advantage and disadvantage of using easy_install compared to apt-get install? Will I get compatibility issues if I use both for different installations?
    – qazwsx
    Feb 1, 2012 at 16:00
  • Yes you will get problems. Problems might be: packages which depend on this package will not 'know' that you already have that installed. You have to remember to run virtualenv evertime you want to use it (if you follow the above). You do not get automatic updates. You can not use Software-Center to get a list of all installed software, and therefore you can not automatically reinstall all your software on a different machine. Probably more...
    – xubuntix
    Feb 1, 2012 at 16:05
  • ...but that's still the easiest way to go if there is no Debian/Ubuntu package, e.g., as with dbfpy. For pyzmq, the solution by xubuntix is much better.
    – krlmlr
    Feb 2, 2012 at 8:35
  • totally agree, if there is no debian package, thats the way to go!
    – xubuntix
    Feb 2, 2012 at 17:51
1

Why not try the later libzmq3 lib + dev tools:

sudo apt-get install --reinstall libzmq3 libzmq3-dev

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .