For two days I have been struggling to install pyzmq and I am really not sure what the issue is.
The error message I receive after:
pip install pyzmq
is:
error: command 'gcc' failed with exit status 1
I have gcc installed.
which gcc
/usr/bin/gcc
Python is installed at the same location. I am really struggling to find a solution.
Edit: Adding to the output from the error, here is the output that describes the error further:
bundled/zeromq/src/signaler.cpp:62:25: fatal error: sys/eventfd.h: No such file or directory
#include <sys/eventfd.h>
^
compilation terminated.
error: command 'gcc' failed with exit status 1
----------------------------------------
Command "/usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip- build-INbMj2/pyzmq/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'),
__file__, 'exec'))" install --record /tmp/pip-n8hQ_h-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-INbMj2/pyzmq
Edit Two: Following installation instructions from https://github.com/zeromq/pyzmq/issues/391
pip install pyzmq --install-option="fetch_libzmq"
Yields :
#include <sys/eventfd.h>
^
compilation terminated.
error: command 'gcc' failed with exit status 1
Next:
pip install --no-use-wheel pyzmq --global-option='fetch_libzmq' --install-option='--zmq=bundled'
Yields:
#include <sys/eventfd.h>
^
compilation terminated.
error: command 'gcc' failed with exit status 1
python3-zmq is a package in cygwin. Assuming you are trying to install for python 3, if you are using apt-cyg package manager, you can install it using
apt-cyg install python3-zmq
This is an old one but I've came across the same error message today. Solved by simply installing libzmq5
and libzmq-devel
(runtime and development) using Cygwin default installation procedure.
Installing IPython in Cygwin with pip was painful but not impossible. This comment by @ahmadia on the zeromq GitHub project gives instructions for installing pyzmq: https://github.com/zeromq/pyzmq/issues/113#issuecomment-25192831
The comment says it's for 64-bit Cygwin but the instructions worked fine for me on 32-bit. I'll summarize the steps assuming install to /usr/local. First download and extract the tarballs for zeromq and pyzmq. Then:
# in zeromq directory
export PKG_CONFIG_PATH=/usr/lib/pkgconfig
./configure --without-libsodium
make
gcc -shared -o cygzmq.dll -Wl,--out-implib=libzmq.dll.a -Wl,--export-all-symbols -Wl,--enable-auto-import -Wl,--whole-archive src/.libs/libzmq.a -Wl,--no-whole-archive -lstdc++
install include/zmq.h /usr/local/include
install include/zmq_utils.h /usr/local/include
install cygzmq.dll /usr/local/bin
install libzmq.dll.a /usr/local/lib
# in pyzmq directory
python setup.py build_ext --zmq=/usr/local --inplace
python setup.py install --zmq=/usr/local --prefix=/usr/local
# finally!
pip install ipython[all]
After that, pip install ipython[all]
just works, notebook included.
Ran into this problem myself. After a lot of research came up with the following:
cygwin does not support the eventfd
functionality. If you check in /usr/include/sys
you'll notice that eventfd.h
is not present. I'm not sure why cygwin doesn't support this -- but I was able to find https://cygwin.com/ml/cygwin/2012-10/msg00198.html which insinuates as much and along with the missing header file my conclusion is we're SOL until such time as that gets added.
For more insight here's the github repo for glibc that contains eventfd.h: https://github.com/lattera/glibc/tree/a2f34833b1042d5d8eeb263b4cf4caaea138c4ad/sysdeps/unix/sysv/linux/sys
Here's a listing of the core devel files included with cygwin (note eventfd is one of the missing files): https://cygwin.com/cgi-bin2/package-grep.cgi?grep=cygwin-devel&arch=x86
BTW -- If you're trying to install ipython notebook (that's how I encountered this error), as a work around I used wakari.io which provides a web interface to the ipython notebook.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With