zeromq / pyzmq

PyZMQ: Python bindings for zeromq
http://zguide.zeromq.org/py:all
BSD 3-Clause "New" or "Revised" License
3.66k stars 638 forks source link

Getting Symbol not found _zmq_errno #568

Closed EleanorCoy closed 10 years ago

EleanorCoy commented 10 years ago

I'm attempting to install and run pyzmq on OS X Mavericks. I have both pyzmq and zeromq installed using the recommended procedures (easy_install for pyzmq, homebrew for zeromq) but when I run, I get the following error:

    import zmq
  File "/Library/Python/2.7/site-packages/pyzmq-14.3.1-py2.7-macosx-10.6-intel.egg/zmq/__init__.py", line 49, in <module>
  File "/Library/Python/2.7/site-packages/pyzmq-14.3.1-py2.7-macosx-10.6-intel.egg/zmq/backend/__init__.py", line 41, in <module>
  File "/Library/Python/2.7/site-packages/pyzmq-14.3.1-py2.7-macosx-10.6-intel.egg/zmq/backend/__init__.py", line 29, in <module>
  File "/Library/Python/2.7/site-packages/pyzmq-14.3.1-py2.7-macosx-10.6-intel.egg/zmq/backend/select.py", line 26, in select_backend
  File "/Library/Python/2.7/site-packages/pyzmq-14.3.1-py2.7-macosx-10.6-intel.egg/zmq/backend/cython/__init__.py", line 6, in <module>
  File "/Library/Python/2.7/site-packages/pyzmq-14.3.1-py2.7-macosx-10.6-intel.egg/zmq/backend/cython/error.py", line 7, in <module>
  File "/Library/Python/2.7/site-packages/pyzmq-14.3.1-py2.7-macosx-10.6-intel.egg/zmq/backend/cython/error.py", line 6, in __bootstrap__
ImportError: dlopen(/Users/ecoy/.python-eggs/pyzmq-14.3.1-py2.7-macosx-10.6-intel.egg-tmp/zmq/backend/cython/error.so, 2): Symbol not found: _zmq_errno
  Referenced from: /Users/ecoy/.python-eggs/pyzmq-14.3.1-py2.7-macosx-10.6-intel.egg-tmp/zmq/backend/cython/error.so
  Expected in: flat namespace
 in /Users/ecoy/.python-eggs/pyzmq-14.3.1-py2.7-macosx-10.6-intel.egg-tmp/zmq/backend/cython/error.so

I checked through the issues and the only similar incident involved 32bit python and 64bit libzmq, which is not my problem.

I believe my pathing is correct.

e-coy-macbook-pro:/usr/local/lib/pkgconfig echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin
e-coy-macbook-pro:/usr/local/lib/pkgconfig echo $DYLD_LIBRARY_PATH
/usr/local

I attempted to build and install pyzmq from the tar ball and that is falling too.

e-coy-macbook-pro:~/2X-CLI/pyzmq-14.0.1 python setup.py configure --zmq=/usr/local
running configure
************************************************
Configure: Autodetecting ZMQ settings...
    Custom ZMQ dir:       /usr/local
cc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -mno-fused-madd -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch x86_64 -arch i386 -pipe -I/usr/local/include -Izmq/utils -Izmq/backend/cython -Izmq/devices -c build/temp.macosx-10.9-intel-2.7/scratch/vers.c -o build/temp.macosx-10.9-intel-2.7/scratch/vers.o
clang: error: unknown argument: '-mno-fused-madd' [-Wunused-command-line-argument-hard-error-in-future]
clang: note: this will be a hard error (cannot be downgraded to a warning) in the future

error: command 'cc' failed with exit status 1

Fatal: Falling back on bundled libzmq, but setup.cfg has explicitly prohibited building the libzmq extension.

One thing I did notice is the complier is clang, not gcc. I also have not been able to find where option "-mno-fused-madd" is being set.

Any help would be appreciated.

minrk commented 10 years ago

The -mno-fused-madd problem is probably due to a general issue that OS X System Python cannot compile anything (yes, it's that bad), due to a recent release of Xcode. There are workarounds, but I would recommend using Python.org Python, or homebrew Python if you can.

What version of OS X are you using?

Your $DYLD_LIRBARY_PATH is incorrect, it should be /usr/local/lib, not /usr/local. Plus, even that should be unnecessary, because /usr/local/lib is on the load path by default.

EleanorCoy commented 10 years ago

Thank you very much for your prompt response. I'm not having any trouble with either zmq or pyzmq on my linux test systems, so I am not surprised by your explanation. Just mightily annoyed at Apple. I am running OS X 10.9.2 and Xcode 5.1.1 (5B1008) with no option to back level (corporation rules you know). I think I'll see if I can force this machine to install and run gcc.