Installing and Running Python 3

Installing

To install the Python interpreter on your computer, follow these steps:

Linux

Run your system's package manager. (On Ubuntu or Debian, I recommend running Synaptic). Find the package for Python 3. On many systems (e.g. Ubuntu) this will be called 'python3'. Install it.

macOS

In a web browser, go to the Python download page. Click the button "Download Python 3.10.1" (it may have a larger number if a newer version is available). When the installer finishes downloading, run it, and accept all the installation defaults.

Windows

In a web browser, go to the Python download page. Click the button "Download Python 3.10.1" (it may have a larger number if a newer version is available). You'll see a message "What do you want to do with python-3.10.1-amd64.exe from python.org?" Click Run.

You'll now see a window "Install Python 3.10.1 (64-bit)". In this window, be sure to check the box "Add Python 3.10 to PATH". Now click "Install Now". You'll see a message "Do you want to allow this app to make changes to your device?" Click Yes.

Running

To run Python:

Linux

Run a terminal. (On many distributions, you can do this by pressing the Super key, then typing "terminal"). In the terminal window, type "python3" at the shell prompt.

macOS

Run a terminal: press Command + Space, type "terminal", then press Enter. In the terminal window, type "python3" at the shell prompt.

Windows

Run a terminal: press the Windows key, type "command", then press Enter. In the Command Prompt (terminal) window, type "python" at the shell prompt.

All systems

On all the systems above, if your Python installation is successful, then running Python should result in output that looks something like this:

$ python3
Python 3.9.7 (default, Sep 10 2021, 14:59:43) 
[GCC 11.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>