Join us and get access to thousands of tutorials and a community of expert Pythonistas.

Unlock This Lesson

This lesson is for members only. Join us and get access to thousands of tutorials and a community of expert Pythonistas.

Unlock This Lesson

Hint: You can adjust the default video playback speed in your account settings.
Hint: You can set your subtitle preferences in your account settings.
Sorry! Looks like there’s an issue with video playback 🙁 This might be due to a temporary outage or because of a configuration issue with your browser. Please refer to our video player troubleshooting guide for assistance.

Installing Python on macOS

Learn how to install Python on macOS. In this lesson, you’ll see how to:

  • Check the current installed version of Python
  • Download latest Python installer from python.org
  • Run the installer package
  • Launch Python from the terminal
  • Launch IDLE3

00:00 Installing on macOS. Here’s the Mac desktop. Most Macs come with Python installed, but it’s normally an older version. The first job is for you to check which versions you have installed.

00:14 Command + Space allows you to search for programs, so you can type “term” to enter Terminal. And here, the command python --version will show us that Python 2.7.15 is installed, and python3 --version shows that Python 3 isn’t installed on this Mac. So that’s the next thing to do.

00:41 Command + Space is a quick way to launch your browser, and then python.org is where we’re headed to download the installer. Clicking on Downloads shows that the site has detected we’re on a Mac, and we can click Python 3.7.3 and then Save File.

00:59 And again, in Firefox, the downloads are at the top. Click that and the installer package will run. Pretty much a case of clicking Continue throughout this.

01:17 We have to Agree to the license and enter the password to allow installation of software. Towards the end of the installation, a folder will appear with useful icons in which are inside your applications folder.

01:38 But back in the installer, it’s now finished. It can be closed and you can move the installer to the trash. Opening a new terminal will allow you to check the version of Python that’s been installed, and you can launch IDLE with the idle3 command. Note that if you just type idle, you get a Python 2 version, which isn’t what you want. And there you go!

02:01 You’re ready to start using Python.

Dirk on May 21, 2019

Should I install python3 on a mac with a virtualenv?

victorariasvanegas on June 11, 2019

I think you should install a version with virtualenv when you have to do a project, but the system version should be installed as shown in the video.

Mike K on June 7, 2020

I recommend using Pyenv (along with pyenv-virutalenv) on both Macs and Linux. I have had to use multiple python versions before, and the way pyenv lets me use one version in one directory and another version in another directory has made my life a lot easier than before. (On that note, I also recommend rbenv and goenv if you work on Ruby or Go)

MAStough on Dec. 1, 2021

Newbie here. When new versions of Python appear (say 3.10.x) and I’ve installed 3.9.x, is there harm in updating and leaving 3.9.x in place?

I do understand and will learn about virtual environments which I feel are good practice for each project (so only necessary packages get installed in the project’s venv); however, for general putzing around and learning the language, should I remove 3.9.x once I update to 3.10.x?

Thanks.

Bartosz Zaczyński RP Team on Dec. 1, 2021

@MAStough I’d highly recommend taking a look at pyenv, which takes care of installing and switching between multiple Python versions without the hassle. We happen to have a tutorial about Managing Multiple Python Versions With pyenv, but the short story is you could use the following commands to install and start using a newer version of Python without uninstalling your current version:

$ python --version
Python 3.9.7

$ pyenv install 3.10.0
$ pyenv global 3.10.0
$ python --version
Python 3.10.0

bisreal004 on Aug. 22, 2022

Hello! Mac has changed its shell to zsh. So when I run python --version it says the command is not found. After googling, I wasn’t able to find a solution. Would someone be able to help me solve this please?

Martin Breuss RP Team on Aug. 23, 2022

@bisreal004 most likely this isn’t because of the shell change in Mac. Command not found means that your shell (either bash or zsh) can’t find the python program.

Can you confirm that you installed it and that it’s available on your PATH?

bisreal004 on Aug. 24, 2022

I see, that makes sense. I was able to install and found that I had python3 installed already. Thank you Martin!

Martin Breuss RP Team on Aug. 25, 2022

Glad this worked and that you can start the interpreter with python3 :)

Become a Member to join the conversation.