简体   繁体   English

如何修复通过 py2app 构建应用程序时发生的错误?

[英]How can I fix the error which occurs while building app via py2app?

When I tried to build for deployment I get an error.当我尝试构建部署时,我得到一个错误。

I typed the following command:我输入了以下命令:

python3 setup.py py2app python3 setup.py py2app

Which results in the following error (this is the last two lines of output):这会导致以下错误(这是输出的最后两行):

copying file /Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.7/Resources/Python.app/Contents/MacOS/Python3 -> /Users/evrim/Desktop/code/WantedOutfits/dist/check_products.app/Contents/MacOS/python error: [Errno 2] /Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.7/Resources/Python.app/Contents/MacOS/Python3: 'No such file or directory'复制文件 /Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.7/Resources/Python.app/Contents/MacOS/Python3 -> /Users/evrim/Desktop/code/WantedOutfits/dist /check_products.app/Contents/MacOS/python 错误:[Errno 2] /Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.7/Resources/Python.app/Contents/MacOS/Python3 : '没有这样的文件或目录'

How can I fix this error?我该如何解决这个错误?

Thank you in advance.先感谢您。

py2app is at this time not entirely compatible with the copy of Python 3.7 shipped as part of Xcode. py2app 目前与作为 Xcode 的一部分提供的 Python 3.7 的副本不完全兼容。

A quick workaround is to create the missing file by copying the file named "Python" in the same directory, that is:一个快速的解决方法是通过在同一目录中复制名为“Python”的文件来创建丢失的文件,即:

cp /Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.7/Resources/Python.app/Contents/MacOS/Python /Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.7/Resources/Python.app/Contents/MacOS/Python3

There is an issue for this in the GitHub tracker for py2app, and I will fix this in a future release.在 py2app 的 GitHub 跟踪器中存在一个问题,我将在未来的版本中解决这个问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM