为什么PyInstaller 无法打包eventlet?
Why does PyInstaller fail to package eventlet?
我正在尝试为精英危险人物制作一个辅助应用程序来帮助探索。代码的主体已经崩溃,现在我正在尝试将本质上是一个 flask / socketio / flaskwebui 应用程序打包成一个 .exe
当我发出以下命令时:
pipenv run pyinstaller EDScout-WebUI\WebUI.py
看来 运行 成功了。但是,当我尝试 运行 生成的 .exe 时,我得到:
C:\Users\Jon\Documents\EDScout\dist>WebUI
Traceback (most recent call last):
File "EDScout-WebUI\WebUI.py", line 7, in <module>
File "c:\users\jon\.virtualenvs\edscout-yes4e1p6\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 623, in exec_module
exec(bytecode, module.__dict__)
File "NavRouteForwarder.py", line 2, in <module>
File "c:\users\jon\.virtualenvs\edscout-yes4e1p6\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 623, in exec_module
exec(bytecode, module.__dict__)
File "site-packages\eventlet\__init__.py", line 10, in <module>
File "c:\users\jon\.virtualenvs\edscout-yes4e1p6\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 623, in exec_module
exec(bytecode, module.__dict__)
File "site-packages\eventlet\convenience.py", line 4, in <module>
File "c:\users\jon\.virtualenvs\edscout-yes4e1p6\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 623, in exec_module
exec(bytecode, module.__dict__)
File "site-packages\eventlet\greenpool.py", line 4, in <module>
File "c:\users\jon\.virtualenvs\edscout-yes4e1p6\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 623, in exec_module
exec(bytecode, module.__dict__)
File "site-packages\eventlet\queue.py", line 49, in <module>
File "c:\users\jon\.virtualenvs\edscout-yes4e1p6\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 623, in exec_module
exec(bytecode, module.__dict__)
File "site-packages\eventlet\event.py", line 3, in <module>
File "c:\users\jon\.virtualenvs\edscout-yes4e1p6\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 623, in exec_module
exec(bytecode, module.__dict__)
File "site-packages\eventlet\hubs\__init__.py", line 19, in <module>
File "site-packages\eventlet\hubs\__init__.py", line 19, in <genexpr>
File "importlib\__init__.py", line 127, in import_module
ModuleNotFoundError: No module named 'eventlet.hubs.epolls'
[20936] Failed to execute script WebUI
完整的源代码可在此处获得:https://github.com/joncage/ed-scout/tree/0004-TurnIntoApp
结果我需要以下内容:
pipenv run pyinstaller ^
--hidden-import=eventlet.hubs.epolls ^
--hidden-import=eventlet.hubs.kqueue ^
--hidden-import=eventlet.hubs.selects ^
因为以下内容还不够:
pipenv run pyinstaller ^
--hidden-import=eventlet
我知道它的老问题,但它可能对某人有所帮助。
我从@jonCage 的回答中得到了提示,但它一直在询问我其他依赖项,我最终对以下模块进行了隐藏导入。下面是我的规范文件的片段。
hiddenimports=[
'eventlet.hubs.epolls',
'eventlet.hubs.kqueue',
'eventlet.hubs.selects',
'dns',
'dns.dnssec',
'dns.e164',
'dns.hash',
'dns.namedict',
'dns.tsigkeyring',
'dns.update',
'dns.version',
'dns.zone'
],
我正在尝试为精英危险人物制作一个辅助应用程序来帮助探索。代码的主体已经崩溃,现在我正在尝试将本质上是一个 flask / socketio / flaskwebui 应用程序打包成一个 .exe
当我发出以下命令时:
pipenv run pyinstaller EDScout-WebUI\WebUI.py
看来 运行 成功了。但是,当我尝试 运行 生成的 .exe 时,我得到:
C:\Users\Jon\Documents\EDScout\dist>WebUI
Traceback (most recent call last):
File "EDScout-WebUI\WebUI.py", line 7, in <module>
File "c:\users\jon\.virtualenvs\edscout-yes4e1p6\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 623, in exec_module
exec(bytecode, module.__dict__)
File "NavRouteForwarder.py", line 2, in <module>
File "c:\users\jon\.virtualenvs\edscout-yes4e1p6\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 623, in exec_module
exec(bytecode, module.__dict__)
File "site-packages\eventlet\__init__.py", line 10, in <module>
File "c:\users\jon\.virtualenvs\edscout-yes4e1p6\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 623, in exec_module
exec(bytecode, module.__dict__)
File "site-packages\eventlet\convenience.py", line 4, in <module>
File "c:\users\jon\.virtualenvs\edscout-yes4e1p6\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 623, in exec_module
exec(bytecode, module.__dict__)
File "site-packages\eventlet\greenpool.py", line 4, in <module>
File "c:\users\jon\.virtualenvs\edscout-yes4e1p6\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 623, in exec_module
exec(bytecode, module.__dict__)
File "site-packages\eventlet\queue.py", line 49, in <module>
File "c:\users\jon\.virtualenvs\edscout-yes4e1p6\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 623, in exec_module
exec(bytecode, module.__dict__)
File "site-packages\eventlet\event.py", line 3, in <module>
File "c:\users\jon\.virtualenvs\edscout-yes4e1p6\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 623, in exec_module
exec(bytecode, module.__dict__)
File "site-packages\eventlet\hubs\__init__.py", line 19, in <module>
File "site-packages\eventlet\hubs\__init__.py", line 19, in <genexpr>
File "importlib\__init__.py", line 127, in import_module
ModuleNotFoundError: No module named 'eventlet.hubs.epolls'
[20936] Failed to execute script WebUI
完整的源代码可在此处获得:https://github.com/joncage/ed-scout/tree/0004-TurnIntoApp
结果我需要以下内容:
pipenv run pyinstaller ^
--hidden-import=eventlet.hubs.epolls ^
--hidden-import=eventlet.hubs.kqueue ^
--hidden-import=eventlet.hubs.selects ^
因为以下内容还不够:
pipenv run pyinstaller ^
--hidden-import=eventlet
我知道它的老问题,但它可能对某人有所帮助。 我从@jonCage 的回答中得到了提示,但它一直在询问我其他依赖项,我最终对以下模块进行了隐藏导入。下面是我的规范文件的片段。
hiddenimports=[
'eventlet.hubs.epolls',
'eventlet.hubs.kqueue',
'eventlet.hubs.selects',
'dns',
'dns.dnssec',
'dns.e164',
'dns.hash',
'dns.namedict',
'dns.tsigkeyring',
'dns.update',
'dns.version',
'dns.zone'
],