问题
Trying to build a simple wxpython app using py2app and using pyenv. I created a virtual environment from whence I run the application and build with py2app. It fails during building on a "no such file or directory" error.
copying file /Users/humberto.a.sanchez.ii/.pyenv/versions/3.8.5/Resources/Python.app/Contents/MacOS/Python -> /Users/humberto.a.sanchez.ii/PycharmProjects/gittodoistclone/dist/PyGitIssueClone.app/Contents/MacOS/python error: [Errno 2] /Users/humberto.a.sanchez.ii/.pyenv/versions/3.8.5/Resources/Python.app/Contents/MacOS/Python: 'No such file or directory'
I have never seen py2app copying such a file or directory. Any help would be appreciated.
I saw something similar here (How can I fix the error which occurs while building app via py2app?).
But I am not using the Xcode python
回答1:
Ok, I found out what the problem was. When I pyenv installed the 3.8.5 version of python, I had not set this environment variable.
PYTHON_CONFIGURE_OPTS=--enable-framework
So once I uninstalled it and re-installed with the above option py2app started working correctly again. Mystery solved.
来源:https://stackoverflow.com/questions/63600819/how-can-i-fix-a-py2app-error-when-building-with-py2app