pyzmq: Unable to make pyzmq work on pypy 5.1.1 32 bit on Windows
Error on use of pyzmq-15.3.0.dev0
When importing pyzmq, compilation claims that “sys/un.h” doesn’t exist although there shouldn’t be such “sys/un.h” because of Windows.
C:\Users\Administrator>pypy -c "import zmq"
_cffi_ext.c
C:\pypy-5.1.1-win32\site-packages\zmq\backend\cffi\__pycache__\_cffi_ext.c(53) : fatal error C1083: Cannot open include file: 'sys/un.h': No such file or directory
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\pypy-5.1.1-win32\site-packages\zmq\__init__.py", line 56, in <module>
from zmq import backend
File "C:\pypy-5.1.1-win32\site-packages\zmq\backend\__init__.py", line 40, in <module>
reraise(*exc_info)
File "C:\pypy-5.1.1-win32\site-packages\zmq\backend\__init__.py", line 27, in <module>
_ns = select_backend(first)
File "C:\pypy-5.1.1-win32\site-packages\zmq\backend\select.py", line 27, in select_backend
mod = __import__(name, fromlist=public_api)
File "C:\pypy-5.1.1-win32\site-packages\zmq\backend\cffi\__init__.py", line 6, in <module>
from zmq.backend.cffi import (constants, error, message, context, socket,
File "C:\pypy-5.1.1-win32\site-packages\zmq\backend\cffi\constants.py", line 4, in <module>
from ._cffi import C, c_constant_names
File "C:\pypy-5.1.1-win32\site-packages\zmq\backend\cffi\_cffi.py", line 100, in <module>
"Please check that you have zeromq headers and libraries." % e)
ImportError: PyZMQ CFFI backend couldn't find zeromq: CompileError: command 'C:\\Program Files (x86)\\Common Files\\Microsoft\\Visual C++ for Python\\9.0\\VC\\Bin\\cl.exe' failed with exit status 2
Please check that you have zeromq headers and libraries.
Error on installation of pyzmq-15.2.0
Building ZeroMQ doesn’t seem to work well.
C:\Users\Administrator>pypy -m pip install pyzmq
Collecting pyzmq
Using cached pyzmq-15.2.0.zip
Requirement already satisfied (use --upgrade to upgrade): py in c:\pypy-5.1.1-win32\site-packages (from pyzmq)
Requirement already satisfied (use --upgrade to upgrade): cffi in c:\pypy-5.1.1-win32\lib_pypy (from pyzmq)
Installing collected packages: pyzmq
Running setup.py install for pyzmq
...
LINK : fatal error LNK1181: cannot open input file 'libsodium.lib'
error: command 'C:\\Program Files (x86)\\Common Files\\Microsoft\\Visual C++ for Python\\9.0\\VC\\Bin\\link.exe' failed with exit status 1181
Environment
- Windows Server 2012 R2 (on EC2)
- Python 2.7.11 and VC++ for Python 27 are installed
- PyPy is downloaded from official site
Note
I’ve not tried http://zeromq.org/docs:windows-installations because I don’t have idea how to build libzmq\builds\msvc\vs2008\libzmq.sln without Visual Studio. (32 bit version of VCBuild.exe doesn’t seem to be included in VC++ for Python 27 so it is impossible to complete C:\Windows\Microsoft.NET\Framework\v3.5\MSBuild.exe libzmq\builds\msvc\vs2008\libzmq.sln.)
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Reactions: 1
- Comments: 27 (5 by maintainers)
Commits related to this issue
- #852 Fix broken cffi backend due to sys/un.h on Windows — committed to sakurai-youhei/pyzmq by sakurai-youhei 4 years ago
I ran into this issue under 64-bit Windows 10 when running
jupyter notebookwith Anaconda 4.3.1. However,pip uninstall pyzmqandpip install pyzmqdid the work for me, even though pip warned me thatI’m also experiencing this issue under OSX 10.11.4. This seems to be an issue with pyzmq’s bundled libzmq combined with pypy. Steps:
-pypy 5.4.1 via brew
brew install pypy-pyzmq viapypy -m pip install pyzmqI then get the same error as @alec-djinn
As a workaround if you install zeromq standalone (e.g. via brew) pyzmq no longer relies on its bundled libzmq, and all is right with the world. So:
-
pypy -m pip uninstall pyzmq-brew install zeromq-pypy -m pip install pyzmqI was facing the same issue when opening jupyter notebook:
The
pip install/uninstall pyzmqdid not work for me. Runningconda install jupyterresolved the issue (note all of these steps were performed while in a conda virtual environment).@Johannes0Horn Did you find the solution for the issue you mentioned? I am having the same issue right now. The pyinstaller cannot work with pyzmq even if I downgrade the pyzmq version.
I can import zmq on win 10 ,anaconda Python 3.7. However when i try to make it part of an executable via pyinstaller i get the exact same issue about missing sys/un.h. pip install/uninstall pyzmq does not help me in this case. Had anybody success with @sakurai-youhei´s fix? To me it leads to a new error:
Because Python 2.7 is no longer supported, I have checked this with pypy3 again.
Windows: 10.0.18363 pypy3: https://bitbucket.org/pypy/pypy/downloads/pypy3.6-v7.3.0-win32.zip pyzmq: pyzmq-19.0.0
And, I’d say nothing seems to have been changed so far; cl.exe reports C1083 due to missing
sys/un.h.This is still an issue (Windows 10, 64-bit Anaconda downloaded on 2018-11-15).
Workaround proposed by @LauriListak solved the issue.
@LauriListak
+2 … I just solved the same error with this method… thanks…