In this tutorial, you'll learn how to install Python on Windows, macOS, and Linux step-by-step using the latest best practices.
Install Python on Windows
1) Download Python Installer
-
Go to the official Python downloads page.
-
Click the link for the latest stable version (e.g., Python 3.13.2).
-
Choose the Windows Installer (64-bit) option to download.
2) Run the Installer
-
Double-click the downloaded installer file.
-
In the installer window:
-
Check the box "Add Python to PATH" at the bottom. This allows you to run Python from the Command Prompt easily.
-
Click Install Now.
-
-
Leave all other options as default.
-
Wait a few minutes for the setup to complete.
3) Verify Installation
-
Open Command Prompt by pressing
Win + R
, typingcmd
, and pressing Enter. -
Check the Python version:
python --version
-
You should see something like:
Python 3.13.2
-
Troubleshooting:
-
If you see an error like:
'python' is not recognized as an internal or external command, operable program or batch file.
-
It likely means you forgot to check Add Python to PATH. Re-run the installer or manually add Python to your system environment variables.
-
Install Python on macOS
Recommended Method
It's best to use the official Python installer for macOS:
Steps
-
Download the latest macOS installer from python.org.
-
Double-click the installer file.
-
Follow the on-screen instructions, clicking Next until the installation completes.
Note: macOS comes with a system version of Python 2.x, but you should always install and use the latest Python 3.x for development.
Verify Installation
-
Open Terminal and run:
python3 --version
-
You should see the installed version, e.g., Python 3.13.2.
Install Python on Linux
Most Linux distributions already come with Python 3 installed. Check first:
Check Existing Python Version
python3 --version
If Python 3 is installed, you'll see the version number. Otherwise, install it:
Install on Ubuntu/Debian
sudo apt update
sudo apt install python3.13
Replace 3.13
with the version you want if needed.
Install on Fedora
sudo dnf install python3
Install on Arch Linux
sudo pacman -S python
Summary
-
Windows, macOS, and Linux users can easily install Python by downloading the official installer or using a package manager.
-
Always install the latest Python 3 version (currently Python 3.13.x).
-
Remember to verify the installation by checking the Python version in your terminal or command prompt.
Now that Python is installed, you're ready to start coding!
Copyright Statement: Unless stated otherwise, all articles are original to this site, please credit the source when sharing.
Article link:http://pybeginners.com/python-tutorial/install-python/
License Agreement:Attribution-NonCommercial 4.0 International License