Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

pyinstaller pack zmq error #1105

Closed
friddle opened this issue Nov 3, 2017 · 2 comments
Closed

pyinstaller pack zmq error #1105

friddle opened this issue Nov 3, 2017 · 2 comments

Comments

@friddle
Copy link

friddle commented Nov 3, 2017

https://github.com/zeromq/pyzmq/blob/master/zmq/__init__.py

when i use pyinstaller to pack my source and I found this problem.
image
And I debug I found that

    try:
        from . import libzmq
    except ImportError:
        pass

In pyinstaller,import error when i execute the pyinstaller executable file.
os.getcwd() is to my execute location,not include libzmq.so。
when I change the location to the folder where include libzmq.so..I could not import libzmq.so ethir
when I copy libzmq.so to excutable root folder and import again.
it is ok,but stranger
this is fix code

     try:
        from . import libzmq
    except ImportError as e:
        #for compatiable pyinstaller runner
        import os;os.chdir(os.path.join(os.path.dirname(__file__),"../"))
        import shutil;
        if os.path.exists("./zmq/libzmq.so"): shutil.copy('./zmq/libzmq.so','./');
        import libzmq

please fix this problem.

other information
pip 9.0.1 from /usr/local/lib/python2.7/site-packages (python 2.7)
pyinstaller 3.3
Darwin sckMacBook-Pro.local 16.7.0 Darwin Kernel Version 16.7.0: Thu Jun 15 17:36:27 PDT 2017; root:xnu-3789.70.16~2/RELEASE_X86_64 x86_64
zmq:0.0.0

@friddle friddle changed the title pyinstaller pack qmz error pyinstaller pack zmq error Nov 3, 2017
@minrk
Copy link
Member

minrk commented Nov 3, 2017

Is the libzmq.so included in the bundle, just not loaded?

@friddle
Copy link
Author

friddle commented Nov 4, 2017

Thanks for answer me.
Forgive my poor english.
I try pack using Pyinstaller in Linux is ok.failed in mac

In mac folder like(I have left my mac in offices,so i draw it)
[executable_folder]
----zmq
-----[libzmq.so]
-----zmq
-------[backend]
-------[python]
----[zmq.backend.*]
And when I debug .it into the zmq folder to import libzmq.so.but failed

I check it in Ubuntu.libzmq.so not in sub folder.so it work ok
image

thanks。

@minrk minrk closed this as completed Feb 27, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants