indygreg / PyOxidizer

A modern Python application packaging and distribution tool
Mozilla Public License 2.0
5.48k stars 239 forks source link

pyzmq cython backend DLL failure #339

Open fleimgruber opened 3 years ago

fleimgruber commented 3 years ago

Version information: Windows 10, PyOxidizer 0.10.3 with cargo.

On a conda environment with zeromq and pyzmq installed, running pyoxidizer run the import of zmq.backend.cython fails with DLL load error.

adding extra file python38.dll to precert
installing files to C:\Users\user\dev\pyapp\.\build\x86_64-pc-windows-msvc\debug\install
Traceback (most recent call last):
  File "runpy", line 194, in _run_module_as_main
  File "runpy", line 87, in _run_code
  File "pyapp.main", line 13, in <module>
  File "zmq", line 55, in <module>
  File "zmq.backend", line 40, in <module>
  File "zmq.utils.sixcerpt", line 34, in reraise
  File "zmq.backend", line 27, in <module>
  File "zmq.backend.select", line 28, in select_backend
  File "zmq.backend.cython", line 6, in <module>
ImportError: DLL load failed while importing error: The specified module could not be found.
error: cargo run failed

I guess this is because the zeromq installation can't be found from within pyzmq in the PyOxidizer context. I read the Packaging User Guide, but could not figure out how PyOxidizer solves these situations internally - or how the user is supposed to resolve this. Any further pointers or am I missing something else? I found #107, but I see my starting point from https://github.com/indygreg/PyOxidizer/issues/107#issuecomment-516267303 where zeromq and pyzmq is already installed in the environment.

zbynekwinkler commented 2 years ago

I am getting something similar on ubuntu with pyoxidizer 0.18. I figured as much that the problem is described in the docs https://pyoxidizer.readthedocs.io/en/stable/pyoxidizer_packaging_extension_modules.html#extension-module-library-dependencies, however I have no idea how to add the missing library.

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "zmq", line 103, in <module>
  File "zmq.backend", line 32, in <module>
  File "zmq.backend", line 27, in <module>
  File "zmq.backend.select", line 32, in select_backend
  File "importlib", line 127, in import_module
  File "zmq.backend.cython", line 6, in <module>
ImportError: libzmq-68c212d3.so.5.2.4: cannot open shared object file: No such file or directory
error: cargo run failed

When I install pyzmq in my venv, I see the missing library in site-packages/pyzmq.libs/libzmq-68c212d3.so.5.2.4.

How do I tell the system to include this library as well?