Hello,
I am new to PsychoPy and am trying to do the tutorial here: Tutorial 1: Generating your first stimulus — PsychoPy v2022.2.4
Whenever I try to do save or run a script, I receive the following error:
Traceback (most recent call last):
File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.8/psychopy/app/coder/coder.py”, line 2623, in runFile
AttributeError: ‘NoneType’ object has no attribute ‘filename’
When I run the simple stimulus code in the tutorial (below), the window with the circle and fixation block appear as expected, but the window immediately freezes, and I need to force exit the window. I am not sure if this error is related to the other error described above.
from psychopy import visual, core # import some libraries from PsychoPy
#create a window
mywin = visual.Window([800,600], monitor="testMonitor", units="deg")
#create some stimuli
grating = visual.GratingStim(win=mywin, mask="circle", size=3, pos=[-4,0], sf=3)
fixation = visual.GratingStim(win=mywin, size=0.5, pos=[0,0], sf=0, rgb=-1)
#draw the stimuli and update the window
grating.draw()
fixation.draw()
mywin.update()
#pause, so you get a chance to see it!
core.wait(5.0)
I am on a Mac (most recent version, OS 12.6) using the standalone PsychoPy installation of 2022.2.4. Please let me know if you would need any other information to debug further.
Thanks,
Steven