Pyinstaller 打包.exe显示failed to execute script 或者failed to execute script pyi_rth_pkgres

出现“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" 
  • 解决办法: 卸载掉你之前的pyinstallerpip 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

如有疑问,欢迎留言!

  • 4
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值