How to Install Python on Mac? | Scaler Topics (original) (raw)

4 mins readLast updated: 17 May 20221.9k views

Python Course for Beginners With Certification: Mastering the Essentials

Python Course for Beginners With Certification: Mastering the Essentials

by Rahul Janghu

1000

Start Learning

Python Course for Beginners With Certification: Mastering the Essentials

Python Course for Beginners With Certification: Mastering the Essentials

Start Learning

Introduction

Welcome to your first steps to becoming a Python developer! Before getting started with this Python tutorial and start developing programs with Python, you would require Python setup on your machines. This article will guide you to install and update Python to the latest version on your macOS devices.

Pre-requisites:

  1. macOS
  2. Log in as administrator on the terminal

Installing Python on your Mac Machine:

By default, python 2.7.0 is installed on macOS; hence we'll be working on updating to the latest version of Python, i.e., python 3.

How to Check Python Version on Mac?

Ways to Install Python on Mac

There are two ways to install the official Python distribution on your machine:

Both these methods will install Python for you, but the official Python foundation maintains only the official installer.

Limitations of Installing from Homebrew

The Python package for macOS that comes with Homebrew doesn’t include the Tcl/Tk dependency required by the Tkinter module. Tkinter is the standard library for developing GUIs (graphical user interfaces) in Python, but it is not part of Python.

Also, homebrew does not install the Tkinter GUI toolkit (it's required for the tinker module); it relies on the existing version of Tkinter that is installed on your machine.

If your system version of the Tkinter module is outdated or missing, homebrew won't import and install the tkinter module. It's a limitation as installing from homebrew is intended for the developers who require a tkinter module.

How to Install Python on Mac From Official Installer?

Installing Python from the official installer is the most reliable installation method on macOS. It includes all the system dependencies needed for developing applications with Python.

Step1: Download the Official Installer

Step2: Run the Installer

  1. Understand the introduction and press continue to move to the next stepsRun Python Installer
  2. Understand the important information and continue to the next stepcontinue to next
  3. Understand the license and continueread the lisence
  4. Select agree if you agree with the agreement and conditions.accept the lisence
  5. Select the destination where you would like to install your files Recommendation is not to change the default location that this installer has selected.select the destination
  6. Installation will start, and you'll get this message once done. You may close this window as now Python 3.0 has been installed on your machine.installation started

How to Install Python from HomeBrew?

The Homebrew package manager is a good option for users who need to install it from the command line. You can install it from the Homebrew package manager in two steps.

  1. Installing Homebrew (Skip if already installed)

Installing Python via homebrew

Make sure that Python has been installed by following these steps:

Stand out in the tech industry with a Python certification. Join our Free Python course and elevate your programming career.

Conclusion

See Also: