Python Pyinstaller";无法编写脚本执行main";问题
编辑:Python 3.7.4,Windows 10 Edit2:我找到了错误的原因。输出:Python Pyinstaller";无法编写脚本执行main";问题,python,pyqt5,pyinstaller,Python,Pyqt5,Pyinstaller,编辑:Python 3.7.4,Windows 10 Edit2:我找到了错误的原因。输出: Traceback (most recent call last): File "myMain.py", line 2, in <module> File "c:\users\faruk\appdata\local\programs\python\python37\lib\site- packages\PyInstaller\loader\pyimod03_importers.py",
Traceback (most recent call last):
File "myMain.py", line 2, in <module>
File "c:\users\faruk\appdata\local\programs\python\python37\lib\site-
packages\PyInstaller\loader\pyimod03_importers.py", line 627, in exec_module
exec(bytecode, module.__dict__)
File "site-packages\PyQt5\__init__.py", line 41, in <module>
File "site-packages\PyQt5\__init__.py", line 33, in find_qt
ImportError: unable to find Qt5Core.dll on PATH
[13936] Failed to execute script myMain
我将此代码用于转换:
pyinstaller main.py --noconsole
当我试图运行exe文件时,出现“无法执行脚本主程序”错误。您安装了这些软件包吗?如果您使用IDE进行编码,您也必须在系统中安装软件包删除pyinstaller和PyQt5,然后使用pip3安装它们
pip3 install pyinstaller
pip3 install PyQt5
我使用的是Vscode、virtualenv和我安装的软件包(仅pyqt5)。代码在转换之前工作得很好。您使用的是windows吗?您还必须在windows系统中安装pyqt5。(命令提示)我正在使用windows。pyqt5仅安装在virtualenv中。我会试试看,不会有什么变化。相同的错误。请尝试以下操作:
pyinstaller-c-F main.py
报告结果。我尝试并打开并关闭了cmd。我添加了一个额外的参数-w,得到了相同的错误。请尝试更改模块名称,例如,将其更改为myMain.py
,然后再次运行pyinstaller-c-F myMain.py
。报告结果。@ImCoder您使用什么版本的PyQt5和PyInstaller?PyInstaller版本3.5我使用的是windows 10,不管是pip还是pip3。我试图重新安装them@ImCoder为什么?看看这个,没什么变化
pip3 install pyinstaller
pip3 install PyQt5