AttributeError: 'Window' object has no attribute '_closed'
The experiment can run, but these errors and warnings have occurred, which may delay the process. How do I fix this? Help~
The experiment can run, but these errors and warnings have occurred, which may delay the process. How do I fix this? Help~
Comments
Hi @Ornella ,
This seems like a bug in PsychoPy, and I suspect you're using an older version of OpenSesame (bundled with an older version of PsychoPy). Is that correct? If so, then I would update to the latest version of OpenSesame.
Also, I don't think the error itself is necessarily a problem, because I suspect it occurs at the very end when the experiment closes, right?
— Sebastiaan
Check out SigmundAI.eu for our OpenSesame AI assistant!
Hi @sebastiaan,
I have updated the version of OpenSesame. It works! Thank you very much!☺️😀
Hi, I am getting the same error, but with opensesame 4.0.32 and psychopy 2024.2.5.
fyi I am trying to run an experiment where for speed reasons the canvases are drawn and stored in advance, and I get this error for every single canvas drawn, i.e. thousands of times per trial, so it kills the functionality of the experiment.
@jevrihanna Can you post the code that you use to create the canvases and the exact error message that you get?
Check out SigmundAI.eu for our OpenSesame AI assistant!
Hi @sebastiaan, the code is as follows. First a template canvas is created:
# setup canvas and stimuli canvas = Canvas(color="gray") fix_pos = (0, ang2pix(7)) fix_symb = "F" if follow else "S" canvas["fix"] = Text(fix_symb, x=fix_pos[0], y=fix_pos[1], color="black", font_size=72, font_bold=True) circle_kwargs = {"color":"black", "penwidth":14} # need to get the image size canvas["image"] = Image(pool[filename]) image_size = canvas["image"].size circle_size = max(image_size)/2 circle_size -= int(round(circle_size * circle_reduction)) del canvas["image"] canvas["circle"] = Circle(0, 0, circle_size, **circle_kwargs) canvas["fix_circle"] = Circle(0, 0, circle_size, **circle_kwargs) # instructions instr_str = follow_str if follow else fix_str if practice: canvas["instructions"] = Text(f"{instr_str}\n\nFirst, keep your focus on the {fix_symb} below.", y=-ang2pix(6), color="black", font_size=48) # get basic parameters calculated img_width = image_size[0] left_point = -1 * (width // 2) - img_width // 2 - circle_kwargs["penwidth"] right_point = (width // 2) + img_width // 2 + circle_kwargs["penwidth"] sleep_time = 1#1000 / mon_refresh - 5 # get the x coordinates cur_x = 0. x_frames = [] # left to centre while cur_x > left_point: x_frames.append(cur_x) cur_x -= pix_per_frame # flip the order to make it left to centre x_frames = x_frames[::-1] # centre to right cur_x = 0. while cur_x < right_point: cur_x += pix_per_frame x_frames.append(cur_x) # flip if right to left if not left: x_frames = x_frames[::-1] canvas["circle"].x = x_frames[0] # block/trial info cur_trial += 1 cur_block = (cur_trial // block_size) + 1 print(f"{cur_trial} {cur_block}")Then we wait for eyetracker fixation:
canvas.show() # wait for eyes to fixate for a certain period of time, and recalibrate if necessary if not wait_for_gaze(fix_pos, 2500, tolerance=32, gaze_timeout=10000): send_triggers(3,'Recalibration start') eyetracker.calibrate() eyetracker.start_recording() send_triggers(4,'Recalibration end') items.run(u"fixate") if practice: del canvas["instructions"] # replace instructional symbol with + del canvas["fix"] canvas["fix"] = Text("+", x=fix_pos[0], y=fix_pos[1], color="black", font_size=48, font_bold=True) canvas.show() # jittered delay clock.sleep(random.randint(jitt_low, jitt_high))Then the canvas is iteratively copied with small translational changes to one object
This error message is repeated 100s of times: