Lesson 2
The Basic Elements
Chapter 2: Installing Python
Installing Python on Windows
You can skip straight to the next page if you are not using Windows.
Windows does not come with a Python interpreter out of the box, so you will need to install this.
There are different ways for you to do this.
I will assume that you are using an up-to-date version of Windows 10.
Option 1
Visit the Microsoft Store (from the Start Menu), search for Python 3.8, and install it from there.
Option 2
Type python
or python3
into the Command Prompt (Windows button, then type cmd
) or Windows Powershell. Windows will automatically redirect you to the Microsoft Store if Python is not yet installed. Make sure that the Python version is 3.8 or above.
Download the appropriate Python installer from the official python.org website.
Run the installer to install Python on your machine.
Check “Add Python 3.8 to PATH” when you install. This will allow you to run Python from the command line (something we will be doing quite a lot).
This is for the techie amongst you!
If you are using the latest version of Windows 10, you can install a virtual Linux bash shell on Windows via what is known as Windows Subsystem for Linux (WSL, more precisely WSL2). This will allow you to run Unix in a terminal directly on Windows, even directly on your files on Windows. You might even be able to run selected Linux Graphical apps in the near future (this is currently under preview).
You will first need to set up WSL2 on your computer. You can then install Python on Linux as instructed on the next page.
This is a good way to start getting used to using Linux machines - you might have to run experiments remotely on the departmental/College Linux machines during your degree!
Follow the instructions on this page if you would like to install WSL2 on Windows. Then install Python according our instructions on the Unix/Linux page.
Check installation
Once you have installed Python, launch a Windows PowerShell console (or Command Prompt). Type in the following to check that Python has been installed correctly.
PS C:\Users\username> python -V
Python 3.8.6
You can also use Windows Terminal to use the command line with multiple tabs and panes.