expyriment is a great Python library to program psychology experiments.
However pip install expyriment
fails with many versions of Python because it tries to recompile pygame
Here we show how to use pyenv to create an environement with Python 3.7.6 in which "pip install expyriment" should work.
sudo apt install -y python3-pip python-is-python3 python3.10-venv