How to install PsychoPy 2022.2.4 on Ubuntu 22.04 using virtualenv

I got psychopy 2023.1.0 to compile with python 3.8 on Ubuntu 22.04 using your technique. The below script should take care of everything, but you may need a reboot after disabling Wayland.

#Disable Wayland
sudo sed -i '/WaylandEnable=false/s/^#//g' /etc/gdm3/custom.conf

#Get Python 3.8
sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt install -y python3.8 python3.8-venv binfmt-support

#Get PIP 3.8
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
python3.8 get-pip.py

sudo apt install -y pipx python3-venv python3-sphinxbase python3-pocketsphinx python3-gst-1.0 python3-wxgtk-webview4.0 python3.8-distutils python3.8-dev gcc-python3-plugin swig pulseaudio* alsa* libwxgtk3* libwxgtk-webview3* libwebkit2gtk* webkit2gtk* libsdl2-2.0-0

#Make the VENV and build wxpython and pyschopy in it
python3.8 -m venv .local/pipx/venvs/psychopy38/
pipx runpip psychopy38 install numpy scipy matplotlib ipython pandas sympy nose suspect pysftp pyopenssl pyprowl python-periphery pydicom testresources PyQt5 pyparallel python-bidi sounddevice moviepy glfw opencv-python esprima astunparse arabic_reshaper pyftdi pyxid pyxid2 pyosf javascripthon pyftdi arabic-reshaper astunparse esprima freetype-py future gevent gitpython glfw imageio imageio-ffmpeg javascripthon jedi json-tricks matplotlib moviepy msgpack msgpack-numpy opencv-python openpyxl packaging pandas psutil pygame pyglet pyopengl pyqt5 python-bidi python-gitlab python-vlc pyyaml pyzmq questplus sounddevice soundfile tables ujson websocket-client xlrd psychtoolbox six wheel setuptools attrdict python-config

pipx runpip psychopy38 install wxPython
pipx runpip psychopy38 install --force-reinstall psychopy
ln -s /home/$USER/.local/pipx/venvs/psychopy38/bin/psychopy /home/$USER/.local/bin/psychopy38
pipx ensurepath
source .bashrc

then execute the following command from the terminal to open the builder, and Bob’s your uncle.

psychopy38 --builder &