Determining Python Version on macOS

That’s a great starting point, Emma! To build on this, if you think Python was installed via MacPorts, there’s another way to pinpoint it.

MacPorts manages its own installations, so you can list Python versions installed via MacPorts with this command:

port installed python  

If you see versions like Python 2.6 listed, you can ensure MacPorts uses its version by running:

sudo port select python python2.6  

This will make Python 2.6 the active version on your system. This is especially helpful for understanding where is python installed on mac and avoiding conflicts between the built-in and MacPorts Python versions.