In this course, we’ll support the use of the Anaconda Python distribution.
You are welcome to use some other setup (e.g. system Python), but you’ll be on your own for troubleshooting.
Download and Install Miniconda¶
You can choose between:
You will only need what is in Miniconda - Anaconda includes a variety of additional bells and whistles that you might find appealing, but we won’t make use of them in this course.
Installation will depend on your operating system. We’ll assume that this goes smoothly.
Installing Miniconda on Linux¶
If you are using bash, then, as per the Miniconda instructions, you can install Miniconda on a Linux machine using the following commands.
mkdir -p ~/miniconda3
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda3/miniconda.sh
bash ~/miniconda3/miniconda.sh -b -u -p ~/miniconda3
rm -rf ~/miniconda3/miniconda.sh
~/miniconda3/bin/conda init bashInstalling Miniconda on macOs¶
If you are using bash, then, as per the Miniconda instructions, you can install Miniconda on a mac using the following commands. If you are using a different terminal, go and see the above instructions.
mkdir -p ~/miniconda3
curl https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-arm64.sh -o ~/miniconda3/miniconda.sh
bash ~/miniconda3/miniconda.sh -b -u -p ~/miniconda3
rm -rf ~/miniconda3/miniconda.sh
~/miniconda3/bin/conda init bashInstalling Miniconda on Windows¶
Install Windows Subsystem for Linux and then see above instructions.
Typically, you can install WSL quite easily by typing wsl --install into Windows Powershell.
Testing installation¶
You should be able to open up a terminal, and type
$ which pythonand see something like
~/miniconda3/bin/pythonYou can also launch a Python interpreter, which should tell you it is an Anaconda distribution:
$ pythonThis will launch a Python REPL:
Python 3.11.16 (main, Aug 27 2026, 14:37:43) [Clang 20.1.8 ] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> type exit(), or type ctrl+d to exit.
You should also have a command called conda available
$ conda --versionShould return
conda 23.8.4(or some similar version)
Create an environment¶
The first thing you’ll want to do is create an environment for this course.
You can also create environments for other courses, research projects etc. Each environment can have different versions of everything - this makes dependency management easy.
We’ll call our environment pycourse. Make sure you specify Python 3.11 in the creation of the environment.
$ conda create -n pycourse python=3.11You can then activate your environment using
$ conda activate pycourseYou will probably see a change in your command prompt to
(pycourse) $Testing your setup¶
If you are in your pycourse environment, you should see you have a new path to Python, and
(pycourse) $ which python
~/miniconda3/envs/pycourse/bin/python
(pycourse) $ python --version
Python 3.11.16Install packages¶
You can also use the conda command to install some packages. Let’s start with
(pycourse) $ conda install ipython numpy scipy sympy matplotlibThis will then print a variety of information. You should see a prompt
Proceed ([y]/n)?hit y and press enter to finish installation.
Test your installation¶
You should now have a new command called ipython, which is an enhanced version of Python
(pycourse) $ which ipython
~/miniconda3/envs/pycourse/bin/ipythonLaunch ipython:
(pycourse) $ ipython
Python 3.11.16 (main, Aug 27 2026, 14:37:43) [Clang 20.1.8 ]
Type 'copyright', 'credits' or 'license' for more information
IPython 9.15.0 -- An enhanced Interactive Python. Type '?' for help.
Tip: Use `--theme`, or the `%colors` magic to change IPython's themes and colors.
In [1]: Now try importing a package (hit enter at the end of each line)
In [1]: import numpy as np
In [2]: a = np.array([1,2,3])
In [3]: a
Out[3]: array([1, 2, 3])
In [4]: exit()