Python3.7+Pyside2 运行exe文件提示“ImportError: DLL load failed: 找不到指定的程序
1.问题描述
a.python 3.7 + pyside2 (只用pyside2,没有使用PyQt5)
b.使用pyinstaller -F xxx.py 打包,生成xxx.exe
c.使用cmd运行exe文件
2.报错
Traceback (most recent call last):
File "PyInstaller\loader\rthooks\pyi_rth_qt5plugins.py", line 47, in
ModuleNotFoundError: No module named 'PyQt5'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "PyInstaller\loader\rthooks\pyi_rth_qt5plugins.py", line 49, in
ImportError: DLL load failed: 找不到指定的程序。
[16072] Failed to execute script pyi_rth_qt5plugins
不知道为啥提示No module named 'PyQt5',在安装的lib中也只有pyside2;
多谢大神指点。
20190730,更新:
经过多次尝试和修改,发现lib库的安装的问题。代码中没有调用QT5的,在lib安装的时候,如果是使用pycharm setting中安装,安装的路径是在项目的文件夹,如果使用python的终端命令pip进行安装,安装在python的lib目录下,两个路径有时候不能完全的调用。
后来重新都是统一使用python 终端 pip命令安装,问题解决。