Python at CUED
In summer 2023, the python set-up on the linux (Rocky9) system was changed.
Typing
python
now runs the newest Python. As before, you can’t install a package on the local system because you’re not the administrator, but you can install packages for your own use. To install a package (e.g. chess) do
python -m venv ~/venv source ~/venv/bin/activate pip install chess
Then you can start python and “import chess” will work.
The first command creates a folder called venv in your home folder, where the downloaded packages etc are installed. You won’t need to re-run that command on subsequent logins, but it won’t do any harm. You will need to re-run the “source ~/venv/bin/activate” command to use the previously downloaded packages.
On the linux (Rocky9) system run
jupyter
to start a set-up where to can load in Jupyter notebooks. If you have a notebook called foo.ipynb you can run it using
jupyter notebook foo.ipynb
The Windows system has the Anaconda suite of python-related programs (including vscode). Look in the “All apps” list. There you’ll also find a “Jupyter Notebook” option that lets you work with notebooks.