【解决】py2app- 打包程序时“encounter a fatal error“

打包程序后运行测试版时遇到报错

(base) RacheldeMacBook-Pro:code_to_be_packed Rachel1900$ ./dist/pic2txt.app/Contents/MacOS/pic2txt
2020-11-23 10:32:00.222 pic2txt[14294:919233] A Python runtime not could be located. You may need to install a framework build of Python, or edit the PyRuntimeLocations array in this application’s Info.plist file.
在这里插入图片描述

分析原因

根据报错信息“You may need to install a framework build of Python, or edit the PyRuntimeLocations array in this application’s Info.plist file”,分析报错原因应该是:py2app 和目前运行的python环境不兼容。

目前./dist/pic2txt.app/Contents/MacOS/pic2txt(base)虚拟环境中,而py2app 在system的python版本中运行,

解决方案:

尝试deactive 虚拟环境base,重新运行应用

(如果系统环境中没有py2app及应用中需要额外安装的包pytesseract等,需在重新运行应用前安装)

<
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值