PyInstaller可执行文件无法执行脚本pyi_rth_qt5plugins

2024-04-20 00:09:40 发布

您现在位置:Python中文网/ 问答频道 /正文

我用pyinstaller创建了一个可执行文件,我可以在我构建它的机器上执行它,但是当我把它转移到另一台机器并在那里运行时,我得到了以下结果:

C:\>myApp.exe
Traceback (most recent call last):
  File "site-packages\PyInstaller\loader\rthooks\pyi_rth_qt5plugins.py", line 47
, in <module>
ModuleNotFoundError: No module named 'PyQt5'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "site-packages\PyInstaller\loader\rthooks\pyi_rth_qt5plugins.py", line 49
, in <module>
  File "c:\users\me\appdata\local\programs\python\python37-32\lib\site-pack
ages\PyInstaller\loader\pyimod03_importers.py", line 627, in exec_module
  File "site-packages\PySide2\__init__.py", line 49, in <module>
  File "site-packages\PySide2\__init__.py", line 21, in _setupQtDirectories
  File "c:\users\me\appdata\local\programs\python\python37-32\lib\site-pack
ages\PyInstaller\loader\pyimod03_importers.py", line 627, in exec_module
  File "site-packages\shiboken2\__init__.py", line 4, in <module>
ImportError: DLL load failed: The specified module could not be found.
[8272] Failed to execute script pyi_rth_qt5plugins

但我用的是PySide2,而不是PyQt5。在

编辑:已解决

不是最好的解决方案,但我解决了重新安装Python、PySide2和pyinstaller的问题。在此过程中,我还将其降级到python3.6.8,这可能也是成功的原因之一。在


Tags: inpyinitpackageslinesiteloaderfile