Skip to content

Installation Instructions

These instructions describe how to set up a working environment for the class. If you run into trouble, raise an issue on the class repository to get help.

Install mamba

mamba is a Python package manager. If you ever used Anaconda: it's got the same interface, but it's much faster: no more 10 minute waits on calculating dependency trees!

On Linux and macOS, you can download the installer shellscript from the miniforge repository then run it in a terminal:

bash {filename}.sh

On Windows, you can download the installer executable following the same link then execute it.

In any of the operating systems, we'll interact with mamba via a command line interface, so please open up a terminal.

Create a new environment

Now we'll install packages in an environment. It's important to create a new environment for this as otherwise all new environments will get the packages, which can cause incompatibility issues.

As pytorch 2.4 support python 3.12, you can create the new environment by

mamba create -n {environment name} python=3.12

Warning

Please do not use curly braces {} in the environment name. For example, if the environment name is DL, then you need to run

mamba create -n DL python=3.12

Activate the environment

You only have to install mamba and create a new environment once. On the other hand, any time you want to work in this environment, you need to activate it first. You can do this via

mamba activate {environment name}
It is important to never forget this before installing packages as otherwise you'll install them to the base environment, which can cause incompatibility issues.

Install Pytorch

Now you can install PyTorch following its Installation Instructions.

  1. Make sure to choose the OS you're using.
  2. Moreover, if you have an Nvidia GPU, check the CUDA version by typing
    nvidia-smi
    
    in a terminal. In Compute Platform in the installation instructions, choose the CUDA version number that is the largest such that it is at most the CUDA version output by nvidia-smi.
  3. Run the pip command shown in the installation instructions in a terminal. You do not have to install torchvision and torchaudio, so you may leave those out.

Install Additional Packages

Now we'll install the most common additional packages we'll use. More packages may be installed as we go along the course. Please run the following in a terminal:

pip install ipywidgets jupyterlab matplotlib pandas scipy scikit-learn seaborn tqdm