Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Supported by

Colorsys import fails

Hi all,

I've been running an experiment in OpenSesame (version 4.0.24) where I display colored circles, and I use colorsys.hls_to_rgb() to set their colors. Everything worked fine for the first dozen participants, but after that the experiment began freezing and occasionally crashing right after I enter the subject number, before the experiment actually starts. Restarting OpenSesame helped temporarily.

Now, after collecting data from 20 participants, the experiment no longer runs at all. It gets stuck on a gray screen before the welcome message appears. I noticed that when I remove import colorsys, the experiment runs again, but then it understandably crashes when it's time to display a circle.

I wanted to report this issue so the developers are aware, and I would also appreciate suggestions for alternative modules/libraries I could use for converting HLS to RGB or setting colors more reliably within OpenSesame.

Thank you in advance for your help!

Best,

Bugay

Here are some further details:

OpenSesame version

Tried running with both 4.0.24 & 4.1.0.

Operating system

On computers running under Windows 10 & 11.

Backend

PsychoPy backend

No error messages.


Comments

  • Hi @bugay

    I'm not sure what's happening here, but here are a few ideas:

    • Check that you have installed the latest version of the library, and/or try uninstalling and reinstalling it (maybe it freezes because it has trouble finding the library). Also ensure that there are no duplicate copies of your colorsys.py file and that it is located in the expected path.
    • Ensure that you are not importing the library multiple times during the experiment, but only at the very start. Also, if you only need the 'colorsys.hls_to_rgb()' function, maybe specify 'from colorsys import hls_to_rgb' when importing and use 'hls_to_rgb()' directly
    • Alternatively, you could try using a custom function (or simply reuse the one defined by colorsys) in a Python inline code, or pre-compute the RGB/HLS colour equivalents instead of doing it on-line during the experiment, if possible.

    If none of these suggestions help, could you share your experiment file so that I can take a look?

    Claire

Sign In or Register to comment.