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.
- The installer adds this location to your shell path. To uninstall MacPython, you can simply remove these three things. A symlink to the Python executable is placed in /usr/local/bin/. The Apple-provided build of Python is installed in /System/Library/Frameworks/Python.framework and /usr/bin/python, respectively. You should never modify or delete these, as they are Apple-controlled and are used by Apple- or third-party software.
- By default MacOS ships with Python-2. But, I guess most of us have long back started to work with Python-3 and it is very irritating to run python3 every time instead of python in terminal.
- Move Python 2 to universe, port all Python applications in main to Python 3. We will never fully get rid of Python 2.7, but since there will also never be a Python 2.8, and Python 2.7 will be nearly 4 years old by the time of the 14.04 LTS release, it is time to relegate Python 2 to universe.
Mac OS X has installed python by default, but the version is 2.7.10. It is a little old, so i decide to upgrade python to the newest version which is 3.6.5 now. But after install new version, when i open a terminal and run python, it still use python 2.7. This issue also exist in Installed Python 3 On Mac OS X But It Still Use Python 2.7 Read More ».
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
Remove Python 2.7 Macro
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: Springfield armory serial numbers.
Run the following command in Terminal:
Remove Python From Mac
When Python 3 is installed on your Mac, you can start the program with:
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:
How To Remove Python 2.7 Mac
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:
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?”.