You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
pyzmq version: 25.0.0
libzmq version: 4.3.4
Python version: 3.10 (venv) on Windows 10
In my project due to performance issues I need to use the low-level C calls.
In the pyzmq be possible to use as in the cimport zmq.backend.cython.libzmq as shown in the example "pyzmq/examples/cython/".
The setup.py:
from setuptools import find_packages, setup
from distutils.extension import Extension
from distutils.core import setup
from Cython.Build import cythonize
from Cython.Distutils import build_ext
import numpy as np
import zmq
# COMMAND TO COMPILE: python setup.py build_ext --inplace
include_dirs = [np.get_include()]+zmq.get_includes()+zmq.get_library_dirs()]
print(include_dirs)
print()
setup(
ext_modules = cythonize([Extension("myproject.libs.cython.fastconverter",
["myproject/libs/cython/fastconverter.pyx"]),
Extension("myproject.libs.cython.ni_fpga_fi.ni_fpga_fi",
["myproject/libs/cython/ni_fpga_fi/ni_fpga_fi.pyx"]),
],
language_level = 3, annotate=True),
include_dirs=include_dirs,
packages=find_packages()
)
After the compilation done with the command
python .\setup.py build_ext --inplace
I get the error:
C:\myproject\venv\lib\site-packages\zmq\utils\zmq_compat.h(20): fatal error C1083: Cannot open include file: 'zmq.h': No such file or directory
I thought to change the include_dirs in the setup.py but actually "zmq.h" do not exist in anywhere in the python site-packages.
I installed pyzmq by using simply:
pip install pyzmq
Is there some options that I can use to install PyZmq keeping the file zmq.h somewhere?
Thanks and
Ciao
The text was updated successfully, but these errors were encountered:
pyzmq installs don't redistribute zmq.h (maybe they should!), so you'll need to get it from libzmq itself during your build process.
This is related to #1412 and #986 where a pyzmq install on its own really does not provide enough information to compile against libzmq. In particular: the libzmq name, which may be mangled by auditwheel, and zmq.h. Not sure if there's anything else needed.
Thank you minrk for your quick answer!
I tried to copy the zmq.h but of course it is not enough because the linker is complaining: I do not have the static libraries (.lib) neither the definition (.def) but I have only the dynamic libraries (.dll).
BTW The reason why I am trying to cimport libzmq in my cython code is due to performance. Unfortunately the cython methods, of the backend of pyzmq, are not always "nogil".
Ah, if you're on Windows that's a lot more complicated and I've no idea how to do it.
And yes, the Cython classes mostly have gil-holding methods, since they deal with Python objects. You'll want to use the libzmq C API (exposed in pyzmq's libzmq.pxd) to actually do gil-free send/recv.
pyzmq version: 25.0.0
libzmq version: 4.3.4
Python version: 3.10 (venv) on Windows 10
In my project due to performance issues I need to use the low-level C calls.
In the pyzmq be possible to use as in the
cimport zmq.backend.cython.libzmq
as shown in the example "pyzmq/examples/cython/".The setup.py:
After the compilation done with the command
I get the error:
I thought to change the include_dirs in the setup.py but actually "zmq.h" do not exist in anywhere in the python site-packages.
I installed pyzmq by using simply:
Is there some options that I can use to install PyZmq keeping the file zmq.h somewhere?
Thanks and
Ciao
The text was updated successfully, but these errors were encountered: