No brew required (except drinking the joyful one at the end of the day) -
Simply download the desired universal2 version from Python Releases for macOS.
(These versions will work for both Intel and Mn (eg M1, M2) Macs.)
The downloaded file is a .pkg
file, which, as expected, you double-click to install.
The process will place some informational files and version-specific IDLE and Python Launcher apps under a version-specific folder in Applications. It will also install the appropriate python
executable in the system frameworks
folder, eg /Library/Frameworks/Python.framework/Versions/3.10/Python
Now,
You can use a virtual environment, such as the one included in PyCharm or explained in python.org's tutorial for Virtual Environments and Packages, by using the appropriate framework version.
You can use the version-specific IDLE app from within the Applications folder.
You can run scripts, without being in Terminal, by either dragging/dropping them onto the Python Launcher app's dock icon OR associating the .py
extension with the launcher app (which will allow you to simply double-click a script in Finder to run it with the launcher app).
Note that if you associate the Launcher app with files, and you have multiple python
versions installed on your Mac, you might want to customize the extension for the python
version you're using (eg, .py3.10
instead of just .py
). That way you can associate a specific version of the Launcher app with the specific version of python
you need for the script.