gpt4 book ai didi

python - 使用 Twisted 的 pyinstaller 导入错误

转载 作者:太空宇宙 更新时间:2023-11-03 15:18:45 25 4
gpt4 key购买 nike

我尝试使用 pyinstaller 编译我的 python 作品,使用命令:

pyinstaller.py -F zchat_server.py

收到错误信息:

F:\workplace\Python\network-study\zchat\dist>zchat_server.exe

Traceback (most recent call last):
File "<string>", line 2, in <module>
File "D:\pyinstaller-2.0\PyInstaller\loader\iu.py", line 386, in importHook
mod = _self_doimport(nm, ctx, fqname)
File "D:\pyinstaller-2.0\PyInstaller\loader\iu.py", line 480, in doimport
exec co in mod.__dict__
File "F:\workplace\Python\network-study\zchat\build\pyi.win32\zchat_server\out
00-PYZ.pyz\twisted", line 53, in <module>
File "F:\workplace\Python\network-study\zchat\build\pyi.win32\zchat_server\out
00-PYZ.pyz\twisted", line 37, in _checkRequirements
ImportError: Twisted requires zope.interface 3.6.0 or later: no module named zop
e.interface.

我是新手,我编译了我的 zchat_view.py(使用 wxPython),它工作得很好。但是对于 Twisted,我很困惑。希望得到解决。

最佳答案

我对此做了一些研究——PyInstaller 和 Zope 似乎存在问题。

以下是一些引用链接:

Problems finding module Zope

PyInstaller fails to find module Zope - 此链接还谈到了一个潜在的解决方案。

Pyinstaller can't handle namespace packages correctly, such as zope.interface .

希望这些可以帮助您确定 PyInstaller 中此错误的解决方法。

回答 Glyph 的查询 - 您可以通过编辑运行 PyInstaller 命令生成的规范文件来为 PyInstaller 定义额外的依赖项

关于python - 使用 Twisted 的 pyinstaller 导入错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18278166/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com