Table of contents
In this article, we'll guide you through the seamless installation of the Python interpreter on your local computer, whether you're using Windows, macOS, or Linux.
Installing on Windows
Download Python:
- Download the latest Python 3 release for Windows on https://www.python.org/ downloads/windows/ and execute the installer. At the time of writing, this is Python 3.6.0.
Setup Path:
- Make sure that the “Install launcher for all users” and “Add Python to PATH” settings are selected and choose “Customize installation”.
Customize Installation:
Ensure "Install launcher for all users" and "Add Python to PATH" are selected.
Opt for "Customize installation" for more control.
Optional Features:
In "Optional Features," consider installing everything.
Essential: Install "pip" (Python package manager) and "pylauncher (for all users).
Advanced Options:
Select "Add Python to environment variables."
Suggestion: Change the install location to something like C:\Python36\ for easy accessibility.
Allow Python to use more than 260 characters on the file system by choosing "Disable path length limit."
Verification:
Open the command line (cmd) and execute "python" or "python3."
If installed correctly, the Python REPL (Read, Evaluate, Print, and Loop) will appear.
Installing on macOS
Download Python:
You can download the latest macOS binary releases from https://www.python.org/ downloads/mac-osx/.
Make sure you download the latest Python 3 release (3.6.4 at the time of writing).
Alternatively, use Homebrew (
brew install python3
) or MacPorts (port install python36
).
Verification:
Open the terminal, execute
python3
, and the Python REPL will be accessible.Type Ctrl+D or
exit()
to leave the REPL.
Installing on Linux
Download Python:
To install Python on Linux, you can download the latest Python 3 source releases from https://www.python.org/downloads/source/ or use your package manager (apt-get, aptitude, synaptic, and others) to install it.
To make sure you have Python 3 installed on your system, run python3 --version in your terminal.
Verification:
Run
python3 --version
in your terminal to confirm Python 3 installation.Open the terminal, execute
python3
, and the Python REPL will be ready.Type Ctrl+D or
exit()
to exit the REPL.
Congratulations! You've successfully installed Python on your system. In the upcoming articles, we'll explore the fundamentals of Python programming.