Pyinstaller 错误运行具有 pyzmq 依赖项的脚本 [英] Pyinstaller error running script with pyzmq dependency

查看:33
本文介绍了Pyinstaller 错误运行具有 pyzmq 依赖项的脚本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我的第一篇 StackOverflow 帖子!

This is my first StackOverflow post!

我在创建具有 pyzmq (v22.0.2) 依赖项的 pyinstaller(v4.2) 可执行文件时遇到问题.我通过运行pyinstaller main.py"创建了一个可执行文件.dist 文件夹的创建没有错误,但是当我在终端中运行可执行文件时,我看到下面引号中的错误.

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.

我在 StackOverflow 和 pyinstaller 的文档中搜索了此类问题,但与我的确切问题不符.我看到提到一个 .spec 文件似乎是类似的问题,但我不确定这是否可行,因为我不清楚 pyzmq.libs\.load_order 是什么.

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]\dist\main>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 "PyInstaller\loader\pyimod03_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]\dist\main>"

推荐答案

我遇到了同样的问题,找到了这个解决方案使用 pip install pyzmq==21.0.0 降级到 21.0.0然后你可以再次运行pyinstaller,它会运行得很好.

I had the same problem and found this solution Downgrade to 21.0.0 using pip install pyzmq==21.0.0 then you can run pyinstaller again and it will run perfectly fine.

这篇关于Pyinstaller 错误运行具有 pyzmq 依赖项的脚本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆