visual.Window() error: module 'psychopy.visual' has no attribute 'Window'

Hello everyone, I am writing about a problem that was mentioned earlier in this forum and has been resolved, but the solutions proposed then do not solve it now. (here - visual.Window() error - #3 by djmannion)

I’m trying to run the code, and I get the following error:
AttributeError: module ‘psychopy.visual’ has no attribute ‘Window’

The relevant code script -
win = visual.Window(
size=[1280, 720], fullscr=True, screen=0,
winType=‘pyglet’, allowGUI=False, allowStencil=False,
monitor=‘testMonitor’, color=[0, 0, 0], colorSpace=‘rgb’,
blendMode=‘avg’, useFBO=True,
units=‘height’)

I have tried suggested solutions like installing pyglet 1.3 / 1.3.2, or changing from pyglet to pygame, and the error still appears.

I have python 3.6.6
psychopy 2021 2.3

thank you

Are you trying to run PsychoPy on a virtual machine?

I tried to run both Psychopy coder and pycharm and it happens in both

Is there a reason why you aren’t running it from PsychoPy?

By virtual machine, I was asking about your Windows. Is it running on Linux or similar?

I have the long code script I want to make changes to, so I figured the PsychoPy coder / PyCharm is the most convenient way. Through the PsychoPy builder one has to divide the code into parts (before routine, start of experiment) and it is less convenient.

and no. I’m not using any virtual machine

Hi Maya, did you solve your problem? I ran into the same, already upgraded pyglet + change and I am running it on pycharm. I could not find a solution to it yet. Maybe you could share yours?

thank you (: