Python

This document will walk you through the process of installing Python 3.12. Please read the beginning of this guide even if you already have Python installed, as we need to ensure that you're using a version of Python that's compatible with the lab's development tools.

Returning UROPs: Note that the version of Python used by the lab is now 3.12. Following the instructions to install below will update your Python version if you’re on an older version. You might need to reinstall your virtual environment. If you need help doing that, ask a peer who knows how or a member of staff.

Check if Python is Installed

Open your terminal and run the following command

macOS
python3 --version
Windows
python --version

If you receive an error or your version of Python is not 3.12.X (where we don't care what X is), skip ahead to Install Python.

If you have Python 3.12 already installed, try the following command in the terminal:

macOS
which python3
Windows
which python

This will output the location of your Python interpreter. If the output contains any reference to 'Anaconda'—a popular Python distribution that you might be using in some of your classes—please follow the instructions below to Install Python.

macOS users should make a habit of typing python3 whenever they need to call Python at the command line, whereas Windows users can simply type python. (This is for legacy reasons: macOS shipped with Python 2.7 for a long time.)

Install Python

Visit the Python download page, download, and install Python 3.12 for your operating system.

On Windows, make sure that you’ve selected the 64-bit Python installer and click Add Python to Path on the first screen.

On macOS, when installation is complete, the Python 3.12 directory will open in your Finder. Double click the "Install Certificates.command" file in this directory to install required security certificates.

Once Python is installed, open your terminal and run:

macOS
python3
Windows
python

This will start the Python Shell, which should report Python version 3.12.X. Try running some code, if you like, and then quit by running quit() in the shell.

Finally, open the terminal and run the following command:

macOS
which python3
Windows
which python

This tells you where on your hard drive your Python interpreter is installed. Please take note of this path; we'll use it later.

If at an earlier stage you discovered that you had Python installed via Anaconda and this path still references Anaconda, try running this command:

conda config --set auto_activate_base false

Restart your terminal and try again. If it STILL references Anaconda, find a team lead or member of staff to help you exorcise your machine.

← Git Node →