Setting up a Python environment

In this course, we will be using python 3. The latest python version, as of Feb 2023, is 3.11.1. It is not necessary to have the latest version: Any version of python from python 3.8.x should be sufficient. However, some of the modules we occasionally use may have new features in newer versions.

The following is our recommended guideline for installing python 3 on your own computer.

Advanced users:

You are free to install python 3 in any way you prefer are not required to follow this guide for the course. Note however that lecturers and tutors will not in general be able to provide technical support for any problems you may face in, or as a result of, doing so.

Our recommendation is that you install the latest Anaconda python distribution which includes the Spyder IDE which is available as a single package here

Why?

  • It is the same one that is installed on the CSIT lab computers and the InfoCommons computers, so everything will look familiar.
  • It comes with not only the python standard library, but also a number of extra modules that we will be using; it also comes with the Spyder IDE.
  • And if that’s not enough to convince you, check this out.

Choosing an IDE#

An Integrated Development Environment, or IDE, for python combines a text editor (for writing programs) with a python shell (interpreter), and some helpful functions to integrate the two.

There are a variety of IDEs available in both the CSIT labs/InfoCommons computers and for download online. You will need to learn to use one of them. (Or, can also use a stand-alone text editor, and the python3 or ipython interpreter through the command-line terminal.)

If you are new to python or just programming in general, or if you have no strong preference, we recommend that you use the Anaconda Spyder IDE, since it’s relatively easy to use and available on all platforms.

If you are interested in what other IDEs are out there, have a look at the alternate IDEs page. Again, we strongly recommend you stick with the Anaconda Spyder IDE that we will be installing below; Lecturers and tutors will not in general be able to provide technical support for any problems you may face using or installing alternative IDEs

The IDE that is used in the lectures is Spyder or VS Code (or VS Codium).

There will be information to help you navigate the Anaconda Spyder IDE in Lab1. (Lab1 does not have any information for navigating other IDEs, consult the documentation of your specific IDE if you used an alternative IDE.)

We provide installation instructions for the Anaconda Spyder IDE. Please refer to the installation guides of your IDE for other IDEs.

Installing Anaconda#

Installing Anaconda Spyder IDE is easy.

  1. Download the latest version of the distribution here. Make sure you select the python 3 version, not the python 2 one.
  2. Run the installer once it is done downloading and follow the prompts. Leave all options in their default state. Click Yes if you are asked to make Anaconda your default Python installation.
  3. Done! You should now be able to find the Spyder IDE in your start menu (in Windows it will be found under the Anaconda3 folder).

We also have a short video that shows the entire process of downloading and installing Anaconda Spyder from start to finish in detail available below.

anaconda install video fake thumbnail.

Extra Info: Anaconda Package Management#

The default, complete installation of Anaconda should provide all the packages you need. If you choose to customise your installation, or if you later discover that you need some other package, Anaconda provides the highly effective conda tool to maintain organised and up to date packages. To update your installed packages:

  1. Open a terminal window
    • Windows users - search for cmd application or check this
    • Mac users - search for terminal app or check this
    • Linux users - help the Mac and Windows users
  2. Type conda update anaconda

Other useful conda commands are:

  • conda info
  • conda help

For more information, read the documentation here

bars search times arrow-up