我使用 pyinstaller 从 python 脚本生成 .exe,它输出得很好,但当我尝试执行时出现此错误。
File "PyInstaller/loader/rthooks/pyi_rth_pkgres.py", line 13, in <module>
File "/home/arturo/.local/lib/python3.6/site-packages/PyInstaller/loader/pyimod03_importers.py", line 623, in exec_module
exec(bytecode, module.__dict__)
File "pkg_resources/__init__.py", line 86, in <module>
ModuleNotFoundError: No module named 'pkg_resources.py2_warn'
[25405] Failed to execute script pyi_rth_pkgres
我已经准备好重新安装setuptools。
最佳答案
感谢您的解决方案。它适用于 Windows 10/python 3.7.2:
pip uninstall pyinstaller
pip install https://github.com/pyinstaller/pyinstaller/archive/develop.zip
关于python - python 上的可执行文件出现问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60152370/