psychopy.org | Reference | Downloads | Github

Problem importing atlas from pyglet.image

Hello,

I needed to install moviepy module to generate videos (mp4) for audio-visual experimentation.
Therefore, I installed moviepy using pip.

However, after the successful installation (I struggled in the beginning), the psychopy codes which were running successfully are suddenly encountering problems now.
I get multiple error messages but the root cause seems to be the failure in importing “atlas.py” from pyglet.image (please refer to the error message below).

File “C:\Program Files (x86)\PsychoPy2\lib\site-packages\pyglet\image_init_.py”, line 149, in
from pyglet.image import atlas
ImportError: cannot import name atlas

When I look inside the site-packages folder, I can see a pyglet folder and inside the image folder, there is “atlas.py”.
Therefore, I do not understand why the code is not running.

I am currently using the old version of Psychopy (v1.82.02rc1).
I am wondering whether updating my Psychopy to the newest version will solve the problem – I avoided the updates because the older version was running very stably.

I would very much appreciate it if I could get some suggestions to solve this problem.
Thank you so much for your time and kindness.

Sincerely,

Takashi

1 Like

Hi Takashi!

Fancy meeting you here! I’m encountering the very same issue! Running PsychoPy Standalone seems to work, which makes it all the more confusing. Everything was working perfectly fine two months ago, but now the very same code won’t run.

Did you try updating?

Best,
–Egor

Hey Egor!

Fancy meeting you here too! I’ve upgraded the PsychoPy Standalone and the error was gone. However, I’m encountering different problem now – i.e., code crashes when I run it. I still have no idea how to tackle this issue. I will keep you posted!

Best,
Takashi

When you use your own installations of Python you can clashes or different versions of libraries that don’t work together. The Standalone distribution is aimed to get around these issues by providing a set of libraries that work correctly together.

To help with the problem that “code crashes when I run it” we would need the error message or a lot more info to help.