Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
375 views
in Technique[技术] by (71.8m points)

python - Pyinstaller error running script with pyzmq dependency

This is my first StackOverflow post!

I am running into issues creating a pyinstaller(v4.2) executable with a pyzmq (v22.0.2) dependency. I created an executable by running "pyinstaller main.py". The dist folder was created without errors but when I run the executable in the terminal, I see the error in quotes below.

I did a search for this kind of issue on StackOverflow and pyinstaller's documentation with no match to my exact problem. I saw mention of a .spec file for what seemed like similar issues, though I am not sure if this is the way to go since I am unclear what pyzmq.libs.load_order is.

Does anyone know how to overcome this error or have good leads on what I may try?

"C:Users[redacted path]distmain>main.exe
Traceback (most recent call last):
  File "main.py", line 1, in <module>
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
  File "PyInstallerloaderpyimod03_importers.py", line 531, in exec_module
  File "zmq\__init__.py", line 19, in <module>
  File "zmq\__init__.py", line 13, in _delvewheel_init_patch_0_0_9
FileNotFoundError: [Errno 2] No such file or directory: 'C:\Users\[redacted path]\dist\main\pyzmq.libs\.load_order'
[4408] Failed to execute script main

C:Users[redacted path]distmain>"
question from:https://stackoverflow.com/questions/66054625/pyinstaller-error-running-script-with-pyzmq-dependency

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Find a folder called 'pyzmq.libs' in your <local-python-path>Libsite-packages.

For example, I'm using Miniconda3 here, so I got this at C:\UsersMyPCMiniconda3envsmy_envLibsite-packages

Then, copy this folder to your C:\Users\[redacted path]\dist\main folder, and re-try the executable.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...