Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

pyinstaller packing zmq error #999

Closed
rickyteng opened this issue Mar 24, 2017 · 4 comments
Closed

pyinstaller packing zmq error #999

rickyteng opened this issue Mar 24, 2017 · 4 comments

Comments

@rickyteng
Copy link

Environment:

Windows 2012
Python27
zerorpc (pip install zerorpc, it will install pyzmq, msgpack-python, gevent, future)
pyinstaller 3.2.1

Steps:
Using pyinstaller pack a py script.

# api.py
# modified from https://www.fyears.org/2017/02/electron-as-gui-of-python-apps-updated.html

from __future__ import print_function

import sys
import zerorpc


class CalcApi(object):

    def calc(self, text):
        """based on the input text, return the int result"""
        try:
            return eval(text)
        except Exception as e:
            return 0.0

    def echo(self, text):
        """echo any text"""
        return text


def parse_port():
    return 4242


def main():
    addr = 'tcp://127.0.0.1:' + str(parse_port())
    s = zerorpc.Server(CalcApi())
    s.bind(addr)
    print('start running on {}'.format(addr))
    s.run()

if __name__ == '__main__':
    main()

packing command

pyinstaller api.py

Error:

4736 INFO: Looking for dynamic libraries
5439 WARNING: lib not found: libzmq.pyd dependency of c:\python27\lib\site-packa
ges\zmq\backend\cython\message.pyd
5532 WARNING: lib not found: libzmq.pyd dependency of c:\python27\lib\site-packa
ges\zmq\backend\cython\_device.pyd
5641 WARNING: lib not found: libzmq.pyd dependency of c:\python27\lib\site-packa
ges\zmq\backend\cython\utils.pyd
5735 WARNING: lib not found: libzmq.pyd dependency of c:\python27\lib\site-packa
ges\zmq\backend\cython\socket.pyd
5844 WARNING: lib not found: libzmq.pyd dependency of c:\python27\lib\site-packa
ges\zmq\backend\cython\_poll.pyd
5937 WARNING: lib not found: libzmq.pyd dependency of c:\python27\lib\site-packa
ges\zmq\backend\cython\context.pyd
6031 WARNING: lib not found: libzmq.pyd dependency of c:\python27\lib\site-packa
ges\zmq\backend\cython\error.pyd
6125 WARNING: lib not found: libzmq.pyd dependency of c:\python27\lib\site-packa
ges\zmq\backend\cython\_version.pyd

Solution:

I found libzmq.pyd located C:\Python27\Lib\site-packages\zmq. I copied it to C:\Python27\Lib\site-packages\zmq\backend\cython. Re-run pyinstaller.

@panamajoecu
Copy link

Thanks rickyteng! Saved me quite a bit a time with this fix!

@glucee
Copy link

glucee commented Aug 9, 2018

Actually, the current Pyinstaller with Python 3.6 on Windows 10 still have the same problem. The solution is still the same: copy libzmq.pyd from Python folder to zmq\backend\cython folder.

@kitattyor
Copy link

Anyone care to share their pyinstaller spec file?

@minrk
Copy link
Member

minrk commented Feb 28, 2024

Closing as old and not really a pyzmq issue. I also suspect that pyzmq 26, which has a single library that statically links libzmq on Windows will also not see this issue.

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

No branches or pull requests

5 participants