pyzmq installation error

2019-02-21 05:41发布

问题:

I receive an error when trying to import zmq:

Traceback (most recent call last):   File "BasicPub.py", line 1, in <module>
    import zmq   File "/home/przemek/Enthought/Canopy_32bit/User/lib/python2.7/site-packages/zmq/__init__.py", line 66, in <module>
    from zmq import backend   File "/home/przemek/Enthought/Canopy_32bit/User/lib/python2.7/site-packages/zmq/backend/__init__.py", line 40, in <module>
    reraise(*exc_info)   File "/home/przemek/Enthought/Canopy_32bit/User/lib/python2.7/site-packages/zmq/backend/__init__.py", line 27, in <module>
    _ns = select_backend(first)   File "/home/przemek/Enthought/Canopy_32bit/User/lib/python2.7/site-packages/zmq/backend/select.py", line 27, in select_backend
    mod = __import__(name, fromlist=public_api)   File "/home/przemek/Enthought/Canopy_32bit/User/lib/python2.7/site-packages/zmq/backend/cython/__init__.py", line 6, in <module>
    from . import (constants, error, message, context, ImportError: /home/przemek/Enthought/Canopy_32bit/User/lib/python2.7/site-packages/zmq/backend/cython/message.so: undefined symbol: zmq_msg_gets

Someone has suggested that I should completely remove zmq and reinstall it.

I have tried to do it with pip but it seems that in some config files remain. I have used locate and I manually removed some directories. I thought that it would help but after reinstallation still I have an error. I am using Python2.7 and Ubuntu 14.04.

回答1:

You can try the following:

sudo rm /usr/local/lib/libzmq*
sudo rm /usr/local/include/zmq.h

Since these are the two locations that ZeroMQ's libzmq installs into.



回答2:

This link provides a few options on how to uninstall zeromq if you use a Debian operating system.

You would need to use the purge command:

sudo apt-get purge --auto-remove python-zmq


回答3:

You probably installed it using the source ditribution. To undo this, cd to the build directory and type:

make uninstall


标签: zeromq pyzmq