Lesson 2
The Basic Elements
Chapter 2: Installing Python
Installing Python
The machines in our labs are currently running on Python 3.12.
We will be officially using the same version of Python for the course. Please make sure that your version of Python is at least the version stated above.
A newer version of Python is fine as long as you do not use any of the fancy new features in that version. It is also your own responsibility to make sure that your code works and runs correctly in this specific version of Python as this will be used to mark your coursework assignments.
In this chapter, I will be covering how to install a standard, official Python distribution.
This will strip everything down to the basics, which will help you understand what goes on behind the scenes better. It also gives you better control on what other libraries you install to your Python installation. Later on in our course, you will be installing more external libraries, so installing things from scratch can help you understand these nitty gritty details better.
You can choose to use another distribution like Anaconda, but only do this if you know what you are doing! Keep in mind though that you will not always be able to get all the latest external libraries via conda because of compatibility issues!
If you already have Python installed on your computer, then you can safely skip this chapter.
I will present installation instructions for each operating system separately, so feel free to skip any irrelevant pages.
If you have problems installing Python, you can try an online interpreter like Google Colab to run your code as a temporary measure until you can get technical help after you arrive at Imperial. Do note that this should be considered a short term measure. You will be required to know how to run scripts spread across multiple files directly from the terminal by the end of the course, and Google Colab is not quite designed for such use cases.
You can also use other online interpreters such as PythonAnywhere. Register for a free beginners account on PythonAnywhere, and you can just use Python on the Cloud until you can get help from us when term starts!