Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

How to install Python paackage pyzmq properly?

I searched in Synapic package manager in vain.

share|improve this question

4 Answers 4

up vote 8 down vote accepted
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".

share|improve this answer
    
Really thankful for the solution. I have been banging my head to get this installed! Thanks again! –  Mohammad Rafay Aleem Aug 25 at 10:35
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 ... .

share|improve this answer

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
share|improve this answer
    
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 '12 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 '12 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 '12 at 8:35
    
totally agree, if there is no debian package, thats the way to go! –  xubuntix Feb 2 '12 at 17:51

Why not try the later libzmq3 lib + dev tools:

sudo apt-get install --reinstall libzmq3 libzmq3-dev
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.