Pyinstaller打包程序提示Failed to execute script pyi_rth_certifi

作者:matrix 发布时间:2021年2月8日 分类:零零星星

本地用miniconda创建的python环境,程序的打包和运行都是正常。但是搬到了其他电脑运行就是失败,死活报错Failed to execute script pyi_rth_certifi。尝试其他打包参数-p --datas --hidden-import,更换python版本和Pyinstaller的develop版本也一样。

图片5291-Pyinstaller打包提示Failed to execute script pyi_rth_certifi

最后还是在cmd命令行打开调试才显示具体信息。
删除dist/,build/目录再使用-c参数重新打包,之后从cmd执行程序才看到详细提示。

最终并不是依赖的问题,只是因为运行环境缺少dll文件导致。😂

解决办法

安装OpenSSL库

下载页面:https://slproweb.com/products/Win32OpenSSL.html

默认安装之后就可以了

参考:

https://bugs.python.org/issue39344

https://slproweb.com/products/Win32OpenSSL.html

Pyinstaller打包报错Failed to execute script pyi_rth_pkgres

https://stackoverflow.com/questions/32093559/exe-file-created-by-Pyinstaller-not-find-self-defined-modules-while-running

https://wiki.openssl.org/index.php/Binaries