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.

Post not yet marked as solved Up vote post of sanhozay Down vote post of sanhozay
45k views
  • 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.

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

Add a Comment

Replies

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.
Post not yet marked as solved Up vote reply of EPaw Down vote reply of EPaw
  • I see the same when executing these commands on a clean Monterey installation. It seems python 3 is not installed by default without any extra step or what is the conclusion here?

    All the people here who find the python 3 installation did then some other step to get python 3 or are there different versions of Monterey circulating?

Add a Comment

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
  • I recently purchased a new MacBook Pro running Monterey v12.0.1. As was mentioned earlier in this thread, python points to python2.7 on this computer.

    I'm using an extension inside Visual Studio Code (VSC) which assumes the command "python" points to "python3". Since it doesn't an error is raised. Unfortunately, there's no setting within the VSC extension to point to python3.

    If I enter the command "alias python=python3" in a terminal and then enter the command "python" in that same terminal, the OS invokes python3. That's great. But inside VSC it still thinks python is equivalent to python2.

    Any suggestions how I can change things so python points to python3 inside VSC?

  • Until Big Sur, I used pyenv to manage multiple python versions on Mac (M1) for my dev work. I haven't tried yet on Monterey (M1) chip. See https://realpython.com/intro-to-pyenv/

  • @PeterMurphy - you've probably found the solution by now, but I DuckDuckGoed "update python default version macos" and found a bunch of tales of how to do it. Which one is best for you will depend on your system/python configuration and what manner of written geek-speak makes the most sense to you; I had to search through several of those articles until I found one that worked for me...and now I can't remember which one it was! :D

    But I think what you want to do is change which python installation the "python" alias points to on a system level, which (it seems to me) should then make VSC use the version you want it to. But doing this may break things...I don't know. I'm just a no0bie to all this.

    Good luck!

Add a Comment

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 Dec. 6, 2021: 3.10.1 https://www.python.org/downloads/macos/ https://www.python.org/ftp/python/3.10.1/python-3.10.1-macos11.pkg

    = (macOS 64-bit universal2 installer)

    :)

Add a Comment

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
  • hey, I got the same issue, how can we solve this issue ...

Add a Comment

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 ! :)

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!

  • It appears I do have AppKit module installed in the Frameworks/Python.Framework..../site-packages directory, but this Python task (from appkit import NSWorkspace) doesn't work.

  • Was never able to get this to run normally. What I had to do was create a Python Virtual Environment to get this to work. If anyone's interested, you can go here: https://python.land/virtual-environments/virtualenv Cheers!

Add a Comment

Python 3.10.7 final

Release date: 2022-09-06

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

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

After install of the .pkg you get an folder Python 3.10 in Applications

Then : launch with Terminal

  • Install Certificates.command
  • Update Shell Profile.command

THATS ALL !

I installed 12.6 yesterday (October 4 2022) and ended up with 3.9.6 for python3. It broke my old python 3.8 applications.