Author:
Joel Gray
Published: 22 January 2024
Read Time: ~3 minutes
How to install Python on Linux, Windows and MacOS
Are you looking to dive into the world of Python programming but unsure how to get started with installing Python on your computer? Whether you’re a budding developer or just exploring coding, our comprehensive guide on “How to Install Python” is your go-to resource.
Python’s popularity stems from its simplicity and versatility, making it a favoured choice for professionals and hobbyists alike.
In this detailed tutorial, we cover the essentials of Python installation across various operating systems, including Debian, Ubuntu, Arch Linux, macOS, and Windows. Each operating system has its unique approach, and we’ve got them all covered for you. From updating package lists in Linux distributions to running installers on Windows, our guide is tailored to make your Python setup experience seamless and straightforward.
TLDR
Linux
Debian/Ubuntu:
sudo apt-get install python3
Arch:
sudo pacman -S python
Windows
- Download installer from python.org
- Run installer
- Select “Add Python to PATH”
- Click “Install”
MacOS
brew install python
Detailed Instructions:
Debian/Ubuntu
Open a Terminal
- Use a keyboard shortcut, typically
Ctrl + Alt + T
.
- Alternatively, you can search for “Terminal” in your system’s application menu and open it from there.
Install Python
Run the following commands, which will install Python using the apt package manager.
Note: You should update your page list first and upgrade any available pages.
sudo apt-get update && sudo apt upgrade
sudo apt-get install python3
Check if Python is Installed
You can type the following command into the terminal and ensure the output lists a Python version of 3 or above.
python3 --version
Arch Linux
Open a Terminal
- Use a keyboard shortcut, typically
Ctrl + Alt + T
.
- Alternatively, you can search for “Terminal” in your system’s application menu and open it from there.
Install Python
Run the following commands, which will install Python using the pacman package manager.
Note: You should update your page list first and upgrade any available pages.
sudo pacman -Sy
sudo pacman -S python
Check if Python is Installed
You can type the following command into the terminal and ensure the output lists a Python version of 3 or above.
python3 --version
Windows
Download Python Installer
- Go to Python.org
- Click on the link for you system – most modern PCs will be
"Windows Installer (64-bit)"
- Download the version installer that you desire, I use Python3.11 currently.
Install Python
- Locate your downloaded installer which probably in your Downloads folder. Depending on what version you install the file will be called something like:
python-3.11.7-amd64.exe
- Run the installer by double clicking on it (It shouldn’t require Administration permissions.).
- When the installer runs use the express/default install.
- Select “Add Python to PATH” before installation.
- Click “Install Now”
Check if Python is Installed
You can type the following command into the terminal and ensure the output lists a Python version of 3 or above.
python --version
MacOS
Open a Terminal
- Open Finder.
- Choose Go from the menu bar ➙ Utilities.
- Scroll down to find Terminal and double-click it to open.
Install Homebrew
If Homebrew is not installed, you should install it first as we need it to install Python. Run the following command to install it.
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Install Python using Homebrew
Type the following command into a terminal and press enter to run it.
brew install python
Check if Python is Installed
You can type the following command into the terminal and ensure the output lists a Python version of 3 or above.
python3 --version
Regardless of what system you’re on you’ll need to install PIP to install Python dependencies and packages. Check out our Blog on how to install Python PIP on each system.
Check out some of our other recent posts