Hi all! I’m using Ubuntu 24.04, python 3.10.13 and the lastest Psychopy I installed with pip install wxpython-4.2.5-cp310-cp310-linux_x86_64.whl and pip install
The problem is that I cannot get any key press with my
kb = keyboard.Keyboard(backend='ptb')
kb.waitKeys(keyList=KEYLIST_DICT["quit"])
And there’s no error message. I also tried a version without the keyList. But again, I didn’t get any responses with any key press.
The same code works perfectly with my Win11 computer.
As I cannot find any useful information online, I asked AI for help. Per Gemini’s suggestion, I tried the following: (None of them worked)
- Switching from Wayland to X11. (Apparently Ubuntu 26 doesn’t support X11 anymore. So I had to reinstall Ubuntu 24 to do this)
- Adding the user to the
inputandpsychtoolboxgroup, by doing
sudo usermod -aG input $USER
sudo groupadd --force psychtoolbox
sudo usermod -aG psychtoolbox $USER - switching the backend of
keyboard.Keyboardbetweeneventandptb. - installing
evdevin my conda environment
And of course, clicking on the window to make sure it’s “in the focus”.
None of them solved the problem.
Any idea what is going on and how can I get psychopy to work on Ubuntu?
Thanks!