Skip to content

wxPython issue under Linux (pip install psychopy tries to build wxPython and fails in most env) #70

Description

@chrplr

When installing under Linux Ubuntu 24.04, the installation of psychopy requires wxpython which,in most situations, will result in a crash as the system tries to build it from source.

uv pip install -r requirements.txt 
Resolved 104 packages in 966ms
  × Failed to build `wxpython==4.3.1`
  ├─▶ The build backend returned an error
  ╰─▶ Call to `setuptools.build_meta.build_wheel` failed (exit status: 1)
[...]
      hint: This usually indicates a problem with the package or the build environment.
  help: `wxpython` (v4.3.1) was included because `psychopy` (v2026.1.3) depends on `wxpython`

Solution:

# Download https://extras.wxpython.org/wxPython4/extras/linux/gtk3/ubuntu-24.04/wxPython-4.2.2-cp310-cp310-linux_x86_64.whl
uv pip install ~/Downloads/wxPython-4.2.2-cp310-cp310-linux_x86_64.whl 

Note: This only works for Python 3.10. Different wheels are needed for different versions of python.

PS1: Under Linux, the installations instructions for psychopy recommend to run the following command to get better timing performance (rt priority). This may be worth adding to your instructions.

sudo groupadd --force psychopy
sudo usermod -a -G psychopy $USER

sudo bash -c 'printf "@psychopy - nice -20\n@psychopy - rtprio 50\n@psychopy - memlock unlimited\n" >>/etc/security/limits.d/99-psychopylimits.conf'

PS2: the doc recommend pyenv. I used to use pyenv, but have switched to uv. If you want to add instructions for uv, here they are:

uv python install 3.10
cd MTB_FOLDER
uv venv --python 3.10
uv pip install -r requirements.txt

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions