UI logo
CS 440/ECE 448
Fall 2023
Margaret Fleck

Using python/pygames on EWS


The EWS linux machines can be used for code development if (for some reason) you can't do it on your own machine. The word at the moment is that the physical EWS labs are open somewhat. Also, you may be able to log in remotely. However, this is probably only an attractive option if your personal machine is truly unusable, e.g. broken. Please see the EWS lab page for the latest information.

To do our MPs on the EWS labs, you need to set up a "virtual environment" in which you have the correct version of python and pygame is installed.

First do the following command, ignoring any warnings that it "cannot stat" various files.

module load python3/3.8.3

Then make a virtual environment with this module loaded. You can replace py440 with your favorite name. This will create a subdirectory with this name, containing all the environment's definitions.

virtualenv py440

Activate your virtual environment

source py440/bin/activate

Install pygame

pip install pygame

You can now start up python and import pygame:

python3
[various chatter from python]
> import pygame

To get out of your virtual environment and then back into it again:

deactivate
source py440/bin/activate