Installation instructions

Install Python & Git

Before installing PyRat, make sure that Python 3 is installed. To check that, open a terminal, and type:

python --version

Depending on your OS (or if you have multiple versions of Python installed), you may want to replace python with python3 or python3.11 (or the version you have) in the command line above. Some versions also have Python called with command py.

If your version is too old, or no Python is installed, please install the latest Python version. During installation, make sure that you check the box to add python to the PATH.

Then, if you are on Windows, you need to install Git. On other systems, it should already be installed.

Install PyRat

The PyRat software on which the course is based can be installed on Linux, MacOS and Windows using the same procedure:

  1. Open a terminal.
  2. Head to https://github.com/BastienPasdeloup/PyRat/.
  3. Follow the instructions on the page (don’t clone the Git repository).
  4. Enjoy!

Troubleshooting

The following boxes list the known issues with the PyRat software, and proposes corrections to them. If you encounter a problem that is not listed here, please ask on the PyRat Discord server, or contact the developer.

Installation errors

On Windows, I cannot make a python -m pip install [git_repo].

  • Install git : download, and install (all options by default);
  • Alternatively, you can download PyRat as a zip file on GitHub, and install it directly with pip.

Command python is not found.

  • Try using python3 or py instead;
  • If that still does not work, Python 3 may not be installed.

On Ubuntu, when using Conda, I get an error libGL error: failed to load driver: swrast.

  • Run the following command: conda install -c conda-forge libstdcxx-ng.

There is a bug OSError: could not get source code when installing playsound dependency.

  • Install it directly with pip using python -m pip install playsound==1.2.2.

On Windows, Python is not in the PATH.

  • First, restart your terminal and re-check if it is here, as the PATH is loaded at terminal startup;
  • Check that Python is indeed installed;
  • If Python is installed, you can go to the system settings to add the Python installation path to the PATH variable, or you can take back the Python installer and check the « Add to PATH » checkbox when installing.

I get an error Self is not defined when creating the PyRat workspace.

  • Upgrade typing_extensions using python -m pip install typing_extensions --upgrade.

On OSX, I get an error Unknown compiler(s) when installing PyRat.

  • Upgrade your Mac to a version >11.

Errors when playing

The game seems to be stuck in preprocessing phase forever.

  • Upgrade your Python version to 3.11 (or more recent).

There is no sound when a cheese is caught.

  • Try reverting to version 1.2.2 of playsound with the following command: python -m pip install playsound==1.2.2.

On Windows, I get an error saying that a file name is too long.

  • Increase the system path limitation using instructions here;
  • Note that Python installer has a checkbox you can tick during installation to bypass that limitation.