r/learnpython • u/silverknife42 • 13h ago
updating Python on macOS
How do you update Python on macOS? I looked it up and from what I can tell, there is no simple command you can enter into the terminal to update it, and you have to instead go to the website https://www.python.org/downloads/ and download and install it manually to update which is inconvenient. There's also the question of removing the old versions you have no intention of using anymore.
I am aware of Homebrew and I do have it for other things I've installed, but I want to try to only use it to download things to my MacBook that I otherwise couldn't. Python can easily be downloaded for mac separately and I want to keep it that way if possible. Is there no update command for the mac terminal to simply update Python?
14
u/SilentBlueberry2 12h ago
Use a package manager for python with virtual environments, otherwise youre updating the system python, which almost certainly is not what you want to do. Use uv or virtualenvs or conda or pixi, depending on what you need to install.
13
u/Classic_Mammoth_9379 12h ago edited 12h ago
Why are you setting arbitrary constraints for yourself?
This is easy on most Linux distributions by using a package manager like yum or apt.
The most popular package manager on macOS is homebrew and you’ve already got it installed. “brew upgrade python”.
9
u/ninhaomah 12h ago
uv
3
u/pythonwiz 9h ago
Homebrew or Macports are the best ways. Or you could write your own script to download and install python then update your symbolic links to point to the new version if you want.
5
u/Mad-riffer 12h ago
If you want to be a serious python dev, look up uv or similar tools. Don’t even use the os python.
2
u/SharkSymphony 11h ago
Nope! The official Python installation on MacOS assumes you'll be installing the same old dirt-simple way Mac users have been installing for aeons: manually download, double-click to install.
Which is why Homebrew comes with cask support, BTW – so that you can install/uninstall Mac apps using its command-line package manager, if that's what floats your boat! Homebrew's no longer just for things you can't install any other way.
But there are plenty of other options for you beyond those two, as outlined in other comments, if you don't like either of those options. Each option has its pros and cons. Pick the one you like the best!
1
u/VintageKofta 2h ago
Honestly. The easiest way I found to maintain and update it is via Homebrew. Same with many other apps too.
1
u/LegalDebate5423 1h ago
If you want to keep the [python.org](http://python.org) install, use its installer for the version you want and leave macOS's own Python alone. For project work, a version manager like `uv` can install Python versions and create isolated environments, so you don't need to replace a system-managed interpreter. Check which executable `which python3` resolves to before removing anything.
•
u/gernophil 4m ago
macOS doesn’t come with a system Python. You are probably using the one from Xcode. Don’t use that outside of Xcode.
I prefer using Python from python.org, but there are other options (brew, conda, uv…). Use one of those. They are pretty easy to update.
0
u/avidresolver 12h ago
I generally don't like updating python in-place, it's liable to break things. Homebrew also IMHO makes it a little hard to figure out which version of python you're using, because it may install different versions depending on what other packages need. I prefer downloading I specific build and installed it manually and deliberately.
0
u/mumpie 12h ago
install homebrew and following their instructions:
https://docs.brew.sh/Language-Runtimes-and-Packages
I currently have 3 different versions of python installed via homebrew (3.13, 3.14, and 3.15).
I used pyenv to switch between the different versions as needed.
Leave the system python alone as it may be used by other applications.