Installing Python

Note: The screenshots shown in these instructions are all based on a Mac, so please make appropriate adjustments for your platform.

Download

The quickest way to install the latest version of Python is to visit https://python.org and download the binary for your platform. A Mac OS X download is shown below.

python download

Install

After downloading the installer (Mac: dmg, Win: msi) use your platform's conventions (double click normally) to install the interpreter.

Configure: Mac PATH

You may want to add the Python installation directory to the PATH environment variable so you can start the interpreter from any folder.

  1. Open up a Terminal which should open in your home (~) directory.

    Apple recommends the use of the zsh shell so if you are still using bash, make sure you update.

  2. At the prompt (~%) type ls .zshrc and press return. If the file is not found type touch .zshrc and press return to create an empty version of the file.

  3. Next type open -e .zshrc to open the file in the TextEdit editor.

    Type the two lines shown and then save the file. Close TextEdit and Terminal

    .zshrc TextEdit

Configure: Win PATH

On Windows the PATH environment variable should be set up by the installer, but if not, add the Python installation folder path to the Path environment variable for the user account.

Verify

Open a shell prompt, i.e. a Terminal on a Mac or Command Prompt on Windows and type python3.9 as shown below. Press the return or enter key to start the interpreter.

Python interpreter verify

Windows note: On Windows type py -3 --version at the prompt and press enter.

C:\> py -3 --version

If successful you will see a brief message followed by >>> the interpreter's prompt. This is the interactive mode of Python, useful for quick explorations of Python code.

To exit the interactive mode type exit() and press return. This will return you to the shell prompt.

Python interpreter exit

[File System] [TOC] [IDE Install]