In this article, we will explain “How to Update Python on Mac?”. Updating Python on your MacBook Pro or iMac can be a tedious process. You need knowledge of terminal on macOS which is different from Windows cmd.exe. Here is a detailed article on how to upgrade Python on your mac.
Python is a popular programming language that is widely used by developers. Modern versions of macOS support Python 2.7.x (or Python 2.6.1 in older versions), but many users need to upgrade to Python 3.6 or 3.7.
You may like “macOS Catalina 10.15.5 Installing Problem – Here’s How to Fix It“.
Here are different methods to Update Python on your Mac
One can install Python without using the terminal on MacBook Air or Mac. For this, you need to download the Python installer from the python.org website. Follow the steps below:
- Visit Python.org and download the latest available Python 3 installer file.
- Run the downloaded file and install Python 3.x on your macOS.
- After completing the installation process, Python 3 will be installed.
- You can see the Python3 folder in /Applications on your Mac. You can also see IDLE in the /Applications.
How to Install Python with Homebrew
Before proceeding installation with Homebrew, it should be installed on your MacBook Pro. If you don’t have Homebrew on your system, you can download it from here. This script installs Homebrew to /user/local so that you don’t need “sudo” when you brew install.
To install python via HomeBrew, Follow these steps below:
Run the following command in Terminal:
brew install python3
When Python 3 is installed on your Mac, you can start the program with:
python3
How to Know the Installed Version of Python
Open the Terminal on your macOS by typing terminal in Spotlight Search. Then use the following command:
python --version
In most cases, Python 2.7.x will be installed on macOS. After installing Python update, you can check the version with the following command:
python3 --version
Note: Just a reminder, you don’t need to remove Python 2.x or update it from 2.x to 3 in your macOS. You just install the updated version, both versions of Python can coexist without any error. These are the most simple techniques to “How to Update Python on Mac?”.
Leave a Reply