Error when running demo: 'Polygon' object has no property 'normed'

Hi,
I have just installed the latest Psychopy version v.2020.2.3 and tried to run demo timeByFrames. The first time I ran the code (through the coder), I got the following error:

## Running: C:\Program Files\PsychoPy3\lib\site-packages\psychopy\demos\coder\timing\timeByFrames.py ##
pygame 1.9.6
Hello from the pygame community. https://www.pygame.org/contribute.html
2.2659     WARNING     Monitor specification not found. Creating a temporary one...
2.2693     WARNING     User requested fullscreen with size [1280 1024], but screen is actually [1536, 864]. Using actual size
Traceback (most recent call last):
  File "C:\Program Files\PsychoPy3\lib\site-packages\psychopy\demos\coder\timing\timeByFrames.py", line 69, in <module>
    pylab.hist(intervalsMS, 50, normed=0, histtype='stepfilled')
  File "C:\Program Files\PsychoPy3\lib\site-packages\matplotlib\pyplot.py", line 2673, in hist
    **({"data": data} if data is not None else {}), **kwargs)
  File "C:\Program Files\PsychoPy3\lib\site-packages\matplotlib\__init__.py", line 1431, in inner
    return func(ax, *map(sanitize_sequence, args), **kwargs)
  File "C:\Program Files\PsychoPy3\lib\site-packages\matplotlib\axes\_axes.py", line 6793, in hist
    p.update(kwargs)
  File "C:\Program Files\PsychoPy3\lib\site-packages\matplotlib\artist.py", line 996, in update
    raise AttributeError(f"{type(self).__name__!r} object "
AttributeError: 'Polygon' object has no property 'normed'
##### Experiment ended. #####

I tried to re-run the code, and got this error:

Traceback (most recent call last):
  File "C:\Program Files\PsychoPy3\lib\site-packages\psychopy\app\coder\coder.py", line 2518, in runFile
    self.app.runner.addTask(fileName=fullPath)
AttributeError: 'NoneType' object has no attribute 'addTask'

I now systematically get the above error whenever I try to run previous codes. Could you please help?

1 Like

I keep getting the same error after the latest Psychopy update. I switched to running the script from terminal now, but I’d like to get it fixed and be able to run it from Psychopy coder as well. Has anybody found a way to fix it?

I downgraded PsychoPy to previous version. Version 2020.2.2 works stable enough for me.

Hope it helpd

Version 2020.2.2 does not solve the crashes when attempting to run the demos (at least on windows 10). For example, running demo “timebyFrames” in the coder returns the following error in the experiment runner (??):

Hello from the pygame community. Contribute - pygame wiki
4.3197 WARNING Monitor specification not found. Creating a temporary one…
4.3314 WARNING User requested fullscreen with size [1280 1024], but screen is actually [1536, 864]. Using actual size
Traceback (most recent call last):
File “C:\Program Files\PsychoPy3\lib\site-packages\psychopy\demos\coder\timing\timeByFrames.py”, line 69, in
pylab.hist(intervalsMS, 50, normed=0, histtype=‘stepfilled’)
File “C:\Program Files\PsychoPy3\lib\site-packages\matplotlib\pyplot.py”, line 2673, in hist
**({“data”: data} if data is not None else {}), **kwargs)
File “C:\Program Files\PsychoPy3\lib\site-packages\matplotlib_init_.py”, line 1431, in inner
return func(ax, *map(sanitize_sequence, args), **kwargs)
File “C:\Program Files\PsychoPy3\lib\site-packages\matplotlib\axes_axes.py”, line 6793, in hist
p.update(kwargs)
File “C:\Program Files\PsychoPy3\lib\site-packages\matplotlib\artist.py”, line 996, in update
raise AttributeError(f"{type(self).name!r} object "
AttributeError: ‘Polygon’ object has no property ‘normed’

Experiment ended.

The issue with

Traceback (most recent call last):
  File "C:\Program Files\PsychoPy3\lib\site-packages\psychopy\app\coder\coder.py", line 2518, in runFile
    self.app.runner.addTask(fileName=fullPath)
AttributeError: 'NoneType' object has no attribute 'addTask'

is a known bug that we’ve fixed in the upcoming bug-fix release (2020.2.4)

The matplotlib error looks like a change in matplotlib - apparently they’ve renamed the argument “normed” to be “density” so change that line to be density=False

By the way, the issue that caused the error with 'NoneType' object has no attribute 'addTask' was simply caused by trying to use the Runner after it had been closed. If you go to the Runner view from the view menu (and leave it open) then your demos will be able to run again!

1 Like

If it still comes up, just replace normed with density. It will surely work.