出现“failed to execute XXX script”
- 有可能是因为你的视频或者图片等资源设置为了绝对路径,你需要将其修改为相对路径,特别是是pygame需要的资源如图片音乐等pyinstaller是不会给你打包的,需手动加入。
- 解决办法: 将你所需要的资源如图片音乐等文件与exe放在同一目录下,运行exe就不会出错了
- 字体的原因,打包后的.exe执行文件无法找到你所设定的字体
- 解决办法: 修改字体,将你的字体修改为常见的形式,不要用一些奇怪的字体
出现 failed to execute script pyi_rth_pkgres
Error running the exe file in Windows "Failed to execute script pyi_rth_pkgres"
- 解决办法: 卸载掉你之前的pyinstaller
pip uninstall pyinstaller
从这个网站"http://www.pyinstaller.org/"下载安装。
也可以选择直接使用
pip install https://github.com/pyinstaller/pyinstaller/archive/develop.zip
这个问题已经被修复
请参考Github的解决方案
https://github.com/pyinstaller/pyinstaller/issues/2137
overstackflow 的解决方案
https://stackoverflow.com/questions/37815371/pyinstaller-failed-to-execute-script-pyi-rth-pkgres-and-missing-packages