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

女生的网名这么多〃 提交于 2021-01-29 09:26:29

问题


When I tried to build for deployment I get an error.

I typed the following command:

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'

How can I fix this error?

Thank you in advance.


回答1:


py2app is at this time not entirely compatible with the copy of Python 3.7 shipped as part of Xcode.

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

There is an issue for this in the GitHub tracker for py2app, and I will fix this in a future release.



来源:https://stackoverflow.com/questions/62544926/how-can-i-fix-the-error-which-occurs-while-building-app-via-py2app

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!