Home > How to Tips

Comprehensive Guide on How to Install Python on Mac

Updated on Friday, June 14, 2024

iBoysoft author Rivers Wong

Written by

Rivers Wong
Professional tech editor

Approved by

Jessica Shee


Summary: In this article, you'll find out how to install Python on Mac, you can install Python from the downloaded official installer, or through HomeBrew. Also, common questions about installing Python on Mac are covered.

How to install Python on Mac

Mostly used in data science and analytics, as well as machine learning, Python is one of the best programming languages developed by Guido van Rossum. For all professional programmers or programming enthusiasts, it's essential to have Python installed on their computers.

If you wonder how to install Python on Mac, you're in the right place. In this article, we'll walk you through the different ways to install the latest version of Python onto a Mac in detail. OK, without further ado, let's get started!

How do I know if Python is installed on my Mac?

Actually, for many years, Python 2.7 is pre-installed on Mac (it is outdated and no longer maintained though). But now, things changed. In the release notes of macOS Catalina in 2019, Apple had offered early hints that Python 2.7 would be removed from macOS in this update.

That is to say, if your Mac's version is between macOS 10.8 to 12.3, there is highly possible that you still have Python 2.7 pre-installed on your Mac. To confirm it and check if your Mac really comes with Python, follow these steps:

  1. Launch Mac Terminal on your device. To do this, you can press the Command + Space bar keys together to open Spotlight Search, type terminal, then hit Return.
  2. In the Terminal window, enter the following command line to check if your Mac had Python pre-installed.Python --versionIf Python is pre-installed on your Mac, you'll get feedback from Terminal, which provides details about the version of Python.check if Python is installed on Mac
  3. Also, if you have multiple versions of Python installed on your Mac, you can specify the Python version by running a command in Terminal. To check Python 2.7, Python --version will do. For Python 3's version, enter this command.
    Python3 --version

As we mentioned above, Python 2.7 is out of date. And the whole Python community has now moved on to using Python 3.x (as of writing, the newest version of Python is 3.10.7). To install Python 3 on Mac, move on!

Think this content is informative? Share it on social media!


How to install Python through the official installer?

The easiest way to install Python on Mac is through Python's official website and from the provided installer. To do this, follow these steps:

  1. Navigate to Python's official website, and click Download Python 3.10.7 to get the installer file of Python. Wait for the download to complete.install Python through the official installer
  2. Once the installer file is downloaded successfully, click on it to proceed. You can follow the on-screen instructions in this installer to finish the installation.follow the instructions to install Python on Mac
  3. When the installation is completed, the installer will automatically open Python's directory in Mac Finder.
    Python directory

Wait a minute! Though Python seems to be installed on your Mac successfully, there's one more step you should do - confirm that Mac has installed Python and IDLE (the integrated development environment shipped with Python) correctly. Here's how to do it:

  1. In Python's installation directory in Finder, double-click on the file named IDLE. A pop-up dialogue box appears, click OK.check if Python is installed correctly
  2. If the installation works correctly, IDLE will launch a Python shell as follows:Python shell
  3. To make sure everything is running smoothly, you can enter a simple Python code and run it in the IDLE window.
    print('Hello, world!')
  4. After entering the above Python code in the IDLE window, hit Return. If the message 'Hello, world!' appears on the interface, then congratulations! You're all set!confirm the correct installation of Python

Install Python on Mac successfully? Share this guide with more people!


How to brew install Python on Mac?

Despite installing Python 3 on Mac from the official installer file, there's another option left for you - install it via Homebrew, a powerful package manager for Mac. If you are one who wants to try something new, then try this. Here's how to install Python on Mac through Homebrew:

  1. Open up Terminal on your Mac. You can find it by going to Mac Launchpad > Other.
  2. In the Terminal window, copy and paste the following command line, then hit Return to install Homebrew on Mac.
    /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
  3. You'll be asked to enter your admin password (the password you enter when logging into your Mac) to confirm the installation of Homebrew. Simply enter it and hit Return, then hit Return again to continue.install Homebrew on mAC
  4. Wait until the whole installing process is over. The process will be updated in the Terminal window in real-time.
  5. Run this command in Terminal, it will install PyEnv on your Mac. This tool helps you to switch between different versions of Python.
    brew install pyenv
  6. Once PyEnv is installed, you can install Python 3 on Mac by running the following command line in Terminal.
    pyenv install 3.10.7 Do not that "3.10.7" represents the newest version number of Python as of writing, you can replace it with "4.0.0" once Python 4.0.0 comes out.

Though installing Python on Mac via Homebrew is a little bit more complex than installing it from the official installer, it's worth a try.

Bonus tip: How to uninstall Python from your Mac?

If you change your mind about using Python on your Mac and want to switch to a different programming language, you can delete Python from your Mac by following these steps:

  1. Navigate to Finder > Applications, select Python and right-click on it, then choose Move to Trash.
    uninstall Python on Mac
  2. Launch Terminal on your Mac, and run this command to remove the Python framework.
    sudo rm -rf /Library/Frameworks/Python.framework
  3. Enter your admin password, then hit Return to confirm the deletion.

After that, Python would be completely removed from your Mac computer, including its framework files.

Like this post? Share it with more people!



In this article, we tell you how to install Python on Mac in two ways, which are installing it through the official installer and through Homebrew. Also, the way to uninstall Python is mentioned above.

We sincerely hope that you've successfully installed Python on your device. From now on, the sky's the limit. You can definitely be a great Pythonista. Thank you for reading this article and happy coding!