TL;DR: 3.10
(major.minor) points already to the latest installed patch-version (5
here). Also recommend to use the Current
folder for the PATH environment-variable like below.
From command to binary location
Assume
python3
is the command
- after running
python3 --version
its version shows as 3.10.5
See also: How to Check Your Python Version | LearnPython.com
Then this command shows the location of the binary for command python3
:
which python3
See also: python location on mac osx, What version of Python is on my Mac?
Apple's Framework convention
The Python installer follows the Framework Versions explained in Apple's Framework Developer Guide:
Frameworks (like Python instead <Name>
) installed by convention in folder:
/System/Library/Frameworks/<Name>.framework/Versions/<major>.<minor>/
with following version numbering-scheme:
<major>.<minor>
(like 3.10
for Python 3.10.5)
where <major>
denotes the major-version (having breaking changes like 3
here) and <minor>
denotes the minor-version (with only small feature-changes and bug-fixes, like 10
here). The patch- or maintenance-version (like 5
here) is ignored in the folder-structure.
A recommended pattern for PATH
environment-variable is to use macOS managed-frameworks' version-alias Current
which points to the latest version installed for the framework. Try listing its contents to see the symbolic-link (also symlink or alias) with command ls -l
followed by the path, for example:
/Library/ManagedFrameworks/Python/Python3.framework/Versions/Current/
See also: macadmins/python: Framework files for use with popular python macadmin toolsets
and symlink - How to get the fully resolved path of a symbolic link in Terminal?
Versioning Schemes