Mac OS Monterey Python Version?

Could someone tell me the default version of Python, installed with Mac OS Monterey? The one symlinked from /usr/bin/python to /System/Library/Frameworks.

For anyone who has Mac OS Monterey installed, it's just a case of opening up Terminal and running 'python --version'.

There is a tool I use that may stop working if the system Python version changes.

Python 2 is version 2.1.18 and Python 3 is version 3.8.9

A new macOS Monterey install shows

user@mbp16 ~ % python --version
Python 2.7.18

user@mbp16 ~ % python3 --version
xcode-select: note: no developer tools were found at '/Applications/Xcode.app', requesting install. Choose an option in the dialog to download the command line developer tools.

After a fresh install you'll have the following:

$ python --version && which python
Python 2.7.18
/usr/bin/python
$ python3 --version && which python3
Python 3.8.9
/usr/bin/python3

An update on realpython.com/intro-to-pyenv/  I had issues with pyenchant not being able to find enchant C library when I used pyenv installer as suggested in this link. However, when I used brew install for all packages including pyenv, pyenv-virtualenv - I was able to have multiple python virtual environments on 2.7.18, 3.9.9 on latest Monterey using M1 silicon 14" pro.

For default Python 3.8.9, I am seeing build errors for pyenv install 3.8.9 command:

pyenv install 3.8.9

python-build: use openssl@1.1 from homebrew

python-build: use readline from homebrew

Downloading Python-3.8.9.tar.xz...

-> https://www.python.org/ftp/python/3.8.9/Python-3.8.9.tar.xz

Installing Python-3.8.9...

python-build: use readline from homebrew

python-build: use zlib from xcode sdk



BUILD FAILED (OS X 12.0.1 using python-build 20180424)



Inspect or clean up the working tree at /var/folders/3f/l881d_r17qj_2q0kt5_6ll9h0000gn/T/python-build.20211123193623.70196

Results logged to /var/folders/3f/l881d_r17qj_2q0kt5_6ll9h0000gn/T/python-build.20211123193623.70196.log

Last 10 log lines:

checking size of _Bool... 1

checking size of off_t... 8

checking whether to enable large file support... no

checking size of time_t... 8

checking for pthread_t... yes

checking size of pthread_t... 8

checking size of pthread_key_t... 8

checking whether pthread_key_t is compatible with int... no

configure: error: Unexpected output of 'arch' on OSX

make: *** No targets specified and no makefile found.  Stop.

In another forum I learnt that 3.9.1 is the python supported for Monterey. Not the ones prior to it.

Version 3.10.0 is the latest and compatible version for macOS Monterey (macOS 10.9 or later)

[NEW] This updated installer provides a hotfix for a problem with the built-in Tk library when running on macOS 12 Monterey. See the ReadMe file for more information.

https://www.python.org/downloads/release/python-3100/

https://www.python.org/ftp/python/3.10.0/python-3.10.0post2-macos11.pkg (macOS 64-bit universal2 installer) :)

Run in folder :Applications/Python 3.10

  • Install Certificates.command
  • Update Shell Profile.command

If you get WARNING: You are using pip version 21.2.3; however, version 21.3.1 is available.

You should consider upgrading via the '/Library/Frameworks/Python.framework/Versions/3.10/bin/python3.10 -m pip install --upgrade pip' command.

type in Terminal :

"python3 -m pip install --upgrade pip"

Latest version available is from Jan. 14, 2022: 3.10.2 https://www.python.org/downloads/macos/ https://www.python.org/ftp/python/3.10.2/python-3.10.2-macos11.pkg = (macOS 64-bit universal2 installer)

:)

Latest version available is from Mar. 23, 2022: 3.10.4 https://www.python.org/downloads/macos/

https://www.python.org/ftp/python/3.10.4/python-3.10.4-macos11.pkg

= (macOS 64-bit universal2 installer)

macOS 12.3.1 Monterey (M1 Pro)

~% python --version
zsh: command not found: python

~% python3 --version
Python 3.8.9

~% python2 --version
zsh: command not found: python2

Yup – only python 3 on Monterey 12.4 that I can find:

~@icu-monterey ~ % python3 --version
Python 3.8.9
~@icu-monterey ~ % python2 --version
zsh: command not found: python2
~@icu-monterey ~ % ```

https://www.python.org/ftp/python/3.10.4/python-3.10.4-macos11.pkg

= (macOS 64-bit universal2 installer) = Universal is for Apple silicon too ! :)

update 2022-06_06 !

https://www.python.org/ftp/python/3.10.5/python-3.10.5-macos11.pkg

= (macOS 64-bit universal2 installer) = Universal is for Apple silicon too ! :)

Python 3.10.6 final

Release date: 2022-08-01

https://www.python.org/ftp/python/3.10.6/python-3.10.6-macos11.pkg

= (macOS 64-bit universal2 installer) = Universal is for Apple silicon too ! :)

I typed that (I have 12.5.1) & I get this: zsh: command not found: python

Came across this post/thread with a problem I'm having. I'm simply trying to run a .py script on macos Monterey 12.5.1, that I found online, to see why my current/active window I'm working in loses focus. When I go to run the script, it returns an error 'ImportError: cannot import name 'NSWorkspace' from 'AppKit'. Anyone know why appkit won't import in python3, and what I need to do to rectify this error? Thanks!

Mac OS Monterey Python Version?
 
 
Q