Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Python

I want to know the clean directory structure of Python 2.7 and Python 3.7 on Mac Catalina. I have been trying to use py2app to make my pygame zero game into a standalone application. And I see missing file errors or module not found errors that suggest that the files and modules have not been installed correctly or are not in the expected locations?

Mac Pro

Posted on Jan 17, 2020 7:33 AM

Reply
Question marked as Best reply

Posted on Jan 17, 2020 11:33 AM

The Python distributions that Apple preinstalls with the operating system (Python 2), or the partial Python 3 installed via Xcode/Command Line tools on Catalina cannot build standalone macOS applications with py2app — because they do not provide a dynamically linked Python library that is essential to a successful py2app build.


Install the Python 3.8.1 64-bit distribution from Python.org. It will install into /Library/Frameworks/Python.framework, and all of the executables will be linked back into /usr/local/bin. The installer will amend your PATH with a path to the preceding Python library at the end of your ~/.bash_profile.


Pip3 will already be installed with Python 3.8.1, and you can then use pip3 to install py2app into the Python 3.8.1 distribution. This should now permit you with a properly configured setup.py to build your standalone Python application. Fall back on the PyPy py2app docs as needed.

Similar questions

4 replies
Question marked as Best reply

Jan 17, 2020 11:33 AM in response to sabahat70

The Python distributions that Apple preinstalls with the operating system (Python 2), or the partial Python 3 installed via Xcode/Command Line tools on Catalina cannot build standalone macOS applications with py2app — because they do not provide a dynamically linked Python library that is essential to a successful py2app build.


Install the Python 3.8.1 64-bit distribution from Python.org. It will install into /Library/Frameworks/Python.framework, and all of the executables will be linked back into /usr/local/bin. The installer will amend your PATH with a path to the preceding Python library at the end of your ~/.bash_profile.


Pip3 will already be installed with Python 3.8.1, and you can then use pip3 to install py2app into the Python 3.8.1 distribution. This should now permit you with a properly configured setup.py to build your standalone Python application. Fall back on the PyPy py2app docs as needed.

Jan 21, 2020 3:33 PM in response to VikingOSX

Thank you so much for your reply!


I had installed Python 3.8 before but then there were compatibility issues with Pygame and Pygame Zero versions on Mac Catalina so I removed it. However, I read about installing different Python versions using virtual environment. How does that work? I want to use it for Python 3.8. Can you guide me how to?

Python

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.