[zeromq-dev] pyzmq curve example code

Greg Ward greg at gerg.ca
Wed Feb 26 15:31:45 CET 2014

On 25 February 2014, MinRK said:
> The weird errno should be fixed in
> master<https://github.com/zeromq/pyzmq/pull/483>.
> But this should only affect the case when libzmq is not linked against
> libsodium. Are you sure that it is?

Arggh. You're quite right; I have must have forgotten
"--with-sodium=/usr/local/zmq4" when I configured libzmq.

Cannot confirm your fix yet, as I'm battling a CFFI error.

In case anyone can throw me a hint, the problem I'm now having is:

$ PYTHONPATH=/data/src/pyzmq python generate_certificates.py 
/data/src/pyzmq/zmq/backend/cffi/__pycache__/_cffi__x5368a726x67d4e236.c:153:17: fatal error: zmq.h: No such file or directory
 #include <zmq.h>
compilation terminated.
Traceback (most recent call last):
  File "generate_certificates.py", line 15, in <module>
    import zmq.auth
  File "/data/src/pyzmq/zmq/__init__.py", line 70, in <module>
    from zmq.backend import *
  File "/data/src/pyzmq/zmq/backend/__init__.py", line 22, in <module>
    _ns = select_backend('zmq.backend.cffi')
  File "/data/src/pyzmq/zmq/backend/select.py", line 31, in select_backend
    mod = __import__(name, fromlist=public_api)
  File "/data/src/pyzmq/zmq/backend/cffi/__init__.py", line 12, in <module>
    from zmq.backend.cffi import (constants, error, message, context, socket,
  File "/data/src/pyzmq/zmq/backend/cffi/constants.py", line 4, in <module>
    from ._cffi import C, c_constant_names
  File "/data/src/pyzmq/zmq/backend/cffi/_cffi.py", line 153, in <module>
    "Please check that you have zeromq headers and libraries." % e)
ImportError: PyZMQ CFFI backend couldn't find zeromq: CompileError: command 'x86_64-linux-gnu-gcc' failed with exit status 1
Please check that you have zeromq headers and libraries.

GCC can't find zmq.h because it's in /usr/local/zmq4/include/zmq.h --
I deliberately uninstalled the system libzmq* packages to avoid
surprises. (I built pyzmq with "python setup.py --zmq=/usr/local/zmq4
build", which works fine until I actually try to import zmq.)

Digging into the CFFI source now to see what's missing where.


More information about the zeromq-dev mailing list