My very first post here, as new comer to MacOS and Python.
Recently installed python 3.10.5
via macOS 64-bit universal2 installer
.pkg file downloaded from python.org > Downloads > mac OS on MacOS 12.4 [M1/Apple Silicon].
In terminal, the command python3
shows the version as 3.10.5
.
But echo $PATH
is giving me a path leading to
/Library/Frameworks/Python.framework/Versions/3.10/bin
I was expecting a folder for the installed Python version with equal name 3.10.5
, however there seems to be no such folder.
Am I missing something?
CodePudding user response:
Python 3.10 is the major release. Python 3.10.5 is a maintenance release of 3.10 that replaces all previous 3.10 versions.
CodePudding user response:
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 as3.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?