Psychtoolbox manylinux2010 wheels

Hi all,

For those interested, I think I’ve had luck successfully building manylinux2010 wheels for psychtoolbox. The repository can be found at, and wheels for python 3.6 and 3.7 can be found at The demos seem to work (minus a segfault in the HID example if I didn’t set sudo setcap cap_sys_nice=eip ... on python).

This may also require a newer version of pip (19.0+?)

That’s fantastic news. I didn’t know that manylinux2010 was generally available. Nice!

We’ll need to chat about how to coordinate - I’m currently maintainer of the project on PyPI so either I need to add you to that or I need to copy over your recipe so I can build the wheels myself.

It looks like there’s just enough infrastructural support now:

I can add you as a collaborator on the repository and/or transfer ownership, would that be sufficient?


I am not very experienced in Ubuntu administration and I have been really struggling with getting psychopy (ver 3.2) installed on 18.4.

First I had tried it with Anaconda utilizing various hints on the net, but gave up after several days, because always some component was missing or apparently the wrong version, when I tried to run demos or own scripts.

Since I decided to use system python it seems I am almost there.
With a lot of help from Google and some trial and error I found I had to downgrade pyglet to 1.3.2 and wxpython to 4.02 for example, but I just can’t make psychtoolbox work.
I had tried many and probably stupid ways of installing psychtoolbox (like apt octave-psychtoolbox-3 and pip3 install psychtoolbox), which I think led to “module not found” or something in psychopy.

Now with one of the wheels mentioned above
( psychtoolbox seems at least to be recognized by psychopy, which was a great relief. However, all scripts requiring keyboard input are crashing with the error message
“PTB-CRITICAL: In call to PsychSetThreadPriority(): Failed to set new basePriority 2, tweakPriority 1, effective 1 [REALTIME] for thread (nil) provided!”.

Can anybody help with that?

Btw I had upgraded pip to the latest version following the above remark concerning HID but for obvious reasons cannot tell whether that helped.

I doubt that’s even needed. I just need to work out what you did and recreate it in my fork of the upstream repo. I might need your advice is all.

@Detlef I think the issue you’re seeing is that your script is failing to run in high-priority mode and psychtoolbox is complaining.

Jon, thanks for your comment.
It was my understanding as well that the problem lies in psychopy’s or psychtoolbox’s inability to change task priority on the Ubuntu machine.
Actually I had overlooked this document, which mentions the solution:
The problem is that one needs to be root on Ubuntu to change priority. There is a script that generates a new privileged group named psychtoolbox and places the user into that group.
The above mentioned document reads,
“To enable use of Priority(), you must run the script PsychLinuxConfiguration at least once and follow its instructions”.
To run that script, after adding the neurodebian ppa to my Ubuntu setup I installed octave and psychtoolbox like that:
sudo apt install octave
sudo apt install psychtoolbox-3-common
sudo apt install octave-psychtoolbox
then I started octave from a terminal (was told to do after first trying the gui version):
octave --no-gui
and executed the (interactive) script
which resides in
After a reboot I was good to go in psychopy
I really wonder why others do not have to go throught that procedure.

1 Like

:+1: Let me know if you want me to clarify anything. I also added Appveyor+Windows wheels over the weekend.

@Detlef Sorry I was unclear, having an up-to-date pip is necessary for installing this sort of wheel in the first place, unrelated to the HID stuff.

Re: allowing changes in priority, you could also use setcap (from the libcap2-bin package if you don’t have it yet, mentioned in the docs for psychopy.core.rush) like:

sudo setcap cap_sys_nice=eip <path to python executable>

This will allow that particular python executable to modify the scheduler machinery when regular users invoke it, but note the warning about potential issues when using with the system python. Also note that psychtoolbox does a little bit more (see 99-psychtoolboxlimits.conf).


Actually there’s another avenue for this. Eric Larson suggesting (below) a combination of azure with cibuildwheel to generate many platforms of wheel in one go

That sounds great, especially with impending manylinux2010 support.

I tried out cibuildwheel for the heck of it (it’s a really nice tool!), and now I’ve built 64-bit wheels for Python 3.6-3.8 on Windows, MacOS, and Linux (wheels here).

The Windows and Linux wheels work well, but YMMV for MacOS (on a borrowed High Sierra machine, the audio examples worked fine; the HID examples failed with a EXC_BAD_INSTRUCTION due to an issue with dispatch_sync, and I didn’t get the chance to diagnose whether it was a OS/PTB/python issue).

1 Like

Very cool Alex, well done. I’ll try and install the wheel on my own mac and see what happens there.

Alex, FYI I’ve pushed your wheels to pypi

I bumped this up to 3.0.17 recently, and now includes wheels for Python 3.9. Wheels here:

1 Like

I’ve updated the wheels on PyPI, now up to psychtoolbox · PyPI

1 Like

I’ve updated the wheels to, which

  • Adds the workaround for the window handle parameter in KbQueueCreate
  • Adds Py 3.10 wheels

Lightly tested on 3.9 & 3.10 on Ubuntu 20.04 & Windows

1 Like

Updated to, which should include the fix for PsychHID crash on macOS + Python 3.8 · Issue #744 · Psychtoolbox-3/Psychtoolbox-3 · GitHub

1 Like