PyQt

pyinstaller 打包pyqt程序无法启动问题解决

2016-12-30  本文已影响909人  木兮家先生

pyinstaller打包的程序启动报错:

Traceback (most recent call last):
  File "site-packages\pyinstaller-3.3.dev0-py3.5.egg\PyInstaller\loader\rthooks\pyi_rth_qt5plugins.py", line 46, in <module>
  File "C:\Users\kang\AppData\Local\Programs\Python\Python35\lib\site-packages\pyinstaller-3.3.dev0-py3.5.egg\PyInstaller\loader\pyimod03_importers.py", line 573, in load_module
    module = loader.load_module(fullname)
ImportError: DLL load failed: The specified module could not be found.
Failed to execute script pyi_rth_qt5plugins

由于加载dll路径依赖有问题

解决方法:

 # 打包时增加 path 参数 指定qt dll目录
pyinstaller --path C:\Python35-32\Lib\site-packages\PyQt5\Qt\bin test.py

参考

上一篇 下一篇

猜你喜欢

热点阅读