Python Updating on macOS

Can someone illuminate how I should 'safely/easily/whatever' upgrade Python on macOS? I have tried before had problems. I try again today, and surprise surprise problems. Now having to restore my entire system because of these problems.


I thought updating should be pretty simple - go to the Python site, download the latest, install, run the 2 commands (certs & path update). However, I did just that trying to update from 3.8.6 today to 3.13.2. It looked fine. The version check showed the 3.13.2. However, when I tried installing the requirements for a new python script it failed multiple times at the 'pip install requirements' phase with some error about/around wheel.


So now I guess I'm stuck with 3.8.6 if I can even get that running again?


Any advice/direction welcome!

Posted on Mar 4, 2025 2:18 PM

Reply
10 replies
Sort By: 

Mar 4, 2025 2:28 PM in response to rothnd

What version of macOS do you currently have installed? Once I know that, I can get you current with Python3 3.13.2.


After macOS Monterey 12.3, Apple stopped including Python 2 in the operating system. Apple has never provided Python 3 in macOS unless via Xcode or the command-line tools for Xcode. Have you installed either of these?

Reply

Mar 4, 2025 3:54 PM in response to rothnd

Python 3.8.6 was a Sept 2020 release. You might consider installing the current Python 3.13.2 from Python.org to stay current with bug fixes and feature updates, although Python 3.9.0 or later versions are still available there.


Any packages that you added to 3.8.6 should be updated for later Python 3 versions using:

/usr/local/bin/pip3 install -U pip
/usr/local/bin/pip3 install -U packagename


Also probably a good idea to have your SHELL PATH set to the following in your SHELL dotfile:

export PATH="$HOME:/Library/Frameworks/Python.framework/versions/current/bin:${PATH}"


These won't be updates per se as they are standalone new version installations into /Library/Frameworks/Python.framework/versions with links back to /usr/local/bin/{python3, pip3, idle3}.

Reply

Mar 4, 2025 7:39 PM in response to VikingOSX

Sorry, I missed this one. I was on 14.7.4. I guess now I’ll be on the current version because, wonderfully, the system is forcing me to upgrade during this restore process. I can’t recall if I installed Xcode or not. Sometimes I do but I don’t think I did on this one, shrug.


I had previously installed v3.8.6 as pre-compiled binary from python.org as part of a requirement for a certain GitHub project I use.

Reply

Mar 5, 2025 9:14 AM in response to rothnd

Download the Python 3.13.2 installer from Python.org. It will install Universal2 binaries meaning that it is supported on Apple Silicon and Intel platforms.


Your old optional, third-party Python packages probably have been updated to work with newer Python versions since 3.8.6. The Python.org install links the current Python 3.13.2 binaries into your /usr/local/bin directory. Once that is done, you can issue these commands (note the explicit path), and -U is update:

/usr/local/bin/pip3 install -U pip
/usr/local/bin/pip3 install -U oldpackage1 oldpackage2 oldpackage3 ... oldpackagen


This will update pip if it needs it and then all of those older packages you may have installed from third parties. The packages will be written into:

/Library/Frameworks/Python.framework/Versions/Current/lib/python3.13/site-packages


and you can confirm what was installed by:

/usr/local/bin/pip3 list


That PATH statement I mentioned earlier goes into your ~/.bash_profile or ~/.zshrc file depending on the SHELL you are currently using.


I tend to place this first line in my Python script files:

#!/usr/bin/env python3



Reply

Python Updating on macOS

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.