Note: The screenshots shown in these instructions are all based on a Mac, so please make appropriate adjustments for your platform.
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.
After downloading the installer (Mac: dmg, Win: msi) use your platform's conventions (double click normally) to install the interpreter.
You may want to add the Python installation directory to the PATH
environment variable so you can start the interpreter from any folder.
Open up a Terminal which should open in your home (~
) directory.
Apple recommends the use of the
zsh
shell so if you are still usingbash
, make sure you update.
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.
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
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.
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.
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.