1

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?

hc_dev
  • 8,389
  • 1
  • 26
  • 38
RoachMartel
  • 13
  • 1
  • 3
  • Good first question! I refined the formatting (including a link) and formulated a concrete question as I read it (please correct me by [edit]). – hc_dev Jun 14 '22 at 19:00

2 Answers2

1

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.

  • 1
    Thank you for your response Christof. Just to be clear, do we need to set or change any paths every time we perform a version update? Or is it only done for major releases? – RoachMartel Jun 14 '22 at 18:14
0

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

hc_dev
  • 8,389
  • 1
  • 26
  • 38
  • Related article from Simon Willison (co-creator of Django): [Installing Python on macOS with the official Python installer](https://til.simonwillison.net/macos/python-installer-macos) – hc_dev Jun 14 '22 at 18:19
  • Thanks for that information. It helped me to clear up several misunderstandings i was having. – RoachMartel Jun 14 '22 at 18:22