Python:pyinstaller打包exe出现“Failed to execute script pyi_rth_qt5plugins”

问题描述

pyinstaller -F **.py命令把.py文件打包成exewindows可执行程序后出现以下错误:
ImportError:Dll load failed :找不到指定模块。
Failed to execute script pyi_rth_qt5plugins

Python:pyinstaller打包exe出现“Failed to execute script pyi_rth_qt5plugins”_第1张图片

解决方法

在打包成exe时,手动指定PyQt5 库bin目录。

Python:pip install PyQT5下载安装 [不看我可能会报错哦]

# 模板
pyinstaller --path <PyQt5 bin目录> -F ***.py
# 举例
pyinstaller --path E:\Anaconda3\envs\test\Lib\site-packages\PyQt5\Qt\bin -F OFHP.py

打包后的exe程序成功运行。

你可能感兴趣的:(Python编程,报错解决,python,exe)