Python is a widely used and powerful programming language that's relatively simple to learn.
Python releases patch updates every few months and major updates around once in a year. Because of this, it is always a good idea to update the version of Python you have on your computer.
In addition, you need to update Python so you can get access to the exciting features they add after major updates. For example, there’s quite a speed improvement in Python 3.11 over 3.10.
Starting from Python 3.4, Pip comes with the standard Python distribution. But if you don’t get it after installing Python for some reason, then you need to install it manually.
In this article, I will show you how to update Python on your Mac and Windows computer. I will also show you how to update Pip on the two operating systems.
What We'll Cover
- How to Update Python and Pip on Mac OS
- How to Update Python and Pip with Homebrew
- How to Update Only Pip with the Terminal
How to Update Python and Pip on Mac OS
One of the easiest ways to update Python and Pip on Mac is by downloading the package from the Python official website.
When you update Python, the Pip version that comes with it is also updated.
First, check the versions of Python and Pip you have by running
python3 --version and
Go to https://www.python.org/downloads/macos/ and select the release you want:
For me, I picked
3.11 because it’s now stable.
Scroll down and download it for your OS – be it Windows or Mac. I chose Mac becuase I use Mac:
Run the installer and follow every prompt you see.
Confirm the installation by running
python3 --version and
How to Update Python and Pip with Homebrew
If you use Mac, you can also update Python and Pip with Homebrew.
pyenv by running
brew install pyenv.
Install any version of Python you want, for instance, 3.9 or 2.7:
You can also update Python by running
pyenv latest-version-number. For example,
python 3.11. When you install that Python version, you install Pip too.
How to Update Only Pip with the Terminal
In cases when you want to update only Pip, open your terminal and run
pip3 install --upgrade pip. You can then confirm the update by running
This article took you through how to update Python and Pip by downloading the installation package and using the command line. We also looked at how you can update Pip only if you want to.
If you are using Windows and you want to update Python and Pip, you can also download the latest installer and let the installation wizard guide you through installing it.
Thanks for reading!