Pyo reported as missing although installed; PTB fails silently, defaulting to pygame in Ubuntu 20.04

Hello all,

I’ve been running into problems with PsychoPy 2022.2.4 (but also 2022.1.2) running under Kubuntu 20.04, in which pyo is reported as missing in the benchmark tool (output pasted below) despite being installed, as shown below:

pip install -U pyo
Requirement already up-to-date: pyo in ./.local/lib/python3.8/site-packages (1.0.4)

Instead, the backend fails to pygame, which has atrocious audio latency. When I try using PTB as the backend, it silently fails to use it as well, again defaulting to pygame and throwing this error the first time a sound is prepared to be called:

File “/STUDIES/st028_PSA-SocialSupport/Archive/PsychoPy/PSA/20221019_PictureSoundAnticipation_TIMING_DELETEME_lastrun.py”, line 3218, in
stimSound.setSound((soundDir + soundFile), secs=6)
File “/home/oem/.local/lib/python3.8/site-packages/psychopy/sound/backend_ptb.py”, line 426, in setSound
_SoundBase.setSound(self, value, secs, octave, hamming, log)
File “/home/oem/.local/lib/python3.8/site-packages/psychopy/sound/_base.py”, line 200, in setSound
self._setSndFromFile(p)
File “/home/oem/.local/lib/python3.8/site-packages/psychopy/sound/backend_ptb.py”, line 459, in _setSndFromFile
self._setSndFromArray(sndArr)
File “/home/oem/.local/lib/python3.8/site-packages/psychopy/sound/backend_ptb.py”, line 502, in _setSndFromArray
self.track.fill_buffer(self.sndArr)
File “/home/oem/.local/lib/python3.8/site-packages/psychtoolbox/audio.py”, line 232, in fill_buffer
buffer = Buffer(stream=self, data=data)
File “/home/oem/.local/lib/python3.8/site-packages/psychtoolbox/audio.py”, line 249, in init
self.handle = PsychPortAudio(‘FillBuffer’, self.stream.handle,
SyntaxError: Missing argument
################# Experiment ended with exit code 1 [pid:3708] #################

Thus, I’ve no idea what I’m doing wrong or how to fix the audio issues so that I can use any backend besides pygame. I’ve read something about the 64 bit version not having pyo from 2019: Pyo in PsychoPy 3 -- missing? but I can’t find the specific thread that talks about 64 bit installations being a problem.

System information:
Linux StimA 5.4.0-107-lowlatency #121-Ubuntu SMP PREEMPT Thu Mar 24 16:45:08 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

Configuration test or setting Version or value Notes
Benchmark
benchmark version 0.1 dots & configuration
full-screen True visual window for drawing
dots_circle 5000
dots_square 5000
available memory 5649.4765625M physical RAM available for configuration test (of 7.7G total)
PsychoPy
psychopy 2022.2.4 avoid upgrading during an experiment
locale en_US.UTF-8 can be set in Preferences → App
python version 3.8.10 (64bit)
wx 4.2.0 gtk3 (phoenix) wxWidgets 3.2.0
pyglet 1.4.10
rush True for high-priority threads
Visual
openGL version 4.5 (Compatibility Profile) Mesa 21.2.6
openGL vendor AMD
screen size 1280 x 1024
have shaders True
visual sync (refresh) 16.66 ms/frame during the drifting GratingStim
refresh stability (SD) 0.03 ms SD < 0.5 ms is ideal (want low variability)
no dropped frames 0 / 180 during DotStim with 100 random dots
openGL max vertices 3000
GL_ARB_multitexture True
GL_EXT_framebuffer_object True
GL_ARB_fragment_program True
GL_ARB_shader_objects True
GL_ARB_vertex_shader True
GL_ARB_texture_float True
GL_ARB_texture_non_power_of_two True
GL_STEREO False
Audio
pyo (missing) Warning: pyo is needed for sound and microphone.
Numeric
numpy 1.17.4 vector-based (fast) calculations
scipy 1.3.3 scientific / numerical
matplotlib 3.1.2 plotting; fast contains(), overlaps()
System
platform linux 5.4.0-107-lowlatency
internet access True for online help, usage statistics, software updates, and google-speech
auto proxy True try to auto-detect a proxy if needed; see Preferences → Connections
proxy setting current manual proxy setting from Preferences → Connections
CPU speed test 0.004 s numpy.std() of 1,000,000 data points
Python packages
PIL 7.0.0
openpyxl 3.0.3
setuptools 45.2.0
pytest 4.6.9
sphinx could not import package sphinx
psignifit could not import package psignifit
pyserial 3.4
pp could not import package pp
pynetstation import ok
labjack could not import package labjack