psychopy.org | Reference | Downloads | Github

TextStims are being positioned correctly on Windows but not on Linux

I had to reinstall Linux and PsychoPy on my computer and I noticed that after doing so, TextStims are no longer being horizontally positioned correctly in an existing PsychoPy experiment. It was previously working fine on Linux. I tested it on Windows and it’s working correctly there as well, so for some reason it just seems to be my new Linux install that has the problem. I’m on an Ubuntu 18.04-based distribution and I followed the installation steps here to install PsychoPy.

Below are a couple of screenshots to show the problem. The first is the experiment on Windows, which displays correctly. The second is the experiment on my new Linux install, which is not displaying correctly. The code is the same and the screen resolution on both computers is the same.


For reference, the TextStim pos x values for the bottom text are all ‘0’. Also, ImageStims, in contrast, are being positioned correctly on both OSes, as can be seen in the screenshots.

The font size also doesn’t seem to be matching up between OSes, as you can see.

Edit: Someone else seems to be having the same problem here.

I fixed it! See the thread here for the solution. The problem seems to be that something changed in the most recent versions of pyglet. Reverting back to an older version of pyglet with the following command fixed it for me:

pip install pyglet==1.3.2

Hope that helps anyone else having this problem!