我发现Mac上的pyinstaller存在此问题,当我单击创建的可执行文件时,会出现此错误:
[9888] Error loading Python lib '/Users/Faris/Downloads/as5/dist/startscreen/Python': dlopen: dlopen(/Users/Faris/Downloads/as5/dist/startscreen/Python, 10): no suitable image found. Did find:
/Users/Faris/Downloads/as5/dist/startscreen/Python: code signature invalid for '/Users/Faris/Downloads/as5/dist/startscreen/Python'
这是一个使用PIL和4个PNG文件的GUI应用程序。我怎样才能解决这个问题
我找到了让它工作的方法。Python库位于dist文件夹中后,运行:
然后运行应用程序
我有一个理论问题是什么,但我不确定。我认为Python库是经过签名的,但是当PyInstaller将其从原始位置移走时,签名验证失败
该命令所做的是用ad-hoc签名替换签名,这允许您在本地运行应用程序,但可能不算作分发的签名。我不能说我完全理解它
在发布应用程序之前,您可能希望用正确的签名替换临时签名
我用以下方法解决了相同的问题:
pip3 uninstall pyinstaller
brew reinstall python
brew install pyinstaller
请注意,在macOS上,python3.7.7或+和python3.8.3或+给出了相同的错误,因为添加了python的完全公证签名,以避免网守警报
只需安装Python3.7.6或Python3.8.2即可
相关问题 更多 >
编程相关推荐