如何修复通过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.
我键入了以下命令:
python3 setup.py py2app
python3 setup.py py2app
这将导致以下错误(这是输出的最后两行):
Which results in the following error (this is the last two lines of output):
复制文件/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:没有这样的文件或目录"
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'
如何解决此错误?
谢谢.
推荐答案
py2app目前与Xcode附带的Python 3.7副本不完全兼容.
py2app is at this time not entirely compatible with the copy of Python 3.7 shipped as part of Xcode.
一种快速的解决方法是通过复制名为"Python"的文件来创建丢失的文件.在同一目录中,即:
A quick workaround is to create the missing file by copying the file named "Python" in the same directory, that is:
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
在py2app的GitHub跟踪器中有一个问题,我将在以后的版本中予以解决.
There is an issue for this in the GitHub tracker for py2app, and I will fix this in a future release.
这篇关于如何修复通过py2app构建应用时出现的错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!