It is recommended you run this demo in a conda environment. For example:
conda create -n pygame-demo python=3.7 --yes
conda activate pygame-demo
conda install -c cogsci pygame --yes
This was tested on MacOSX, but it should work on other platforms as well.
This will set up the environment so you can then run them demo via:
python pygame-demo.py