PsychoPy crashes when using coder (on Mac Catalina)

Hi there,

I get the following error every time I type a new command into coder. I can run existing scripts, but I get interrupted every few seconds when trying to write a new script. The program doesn’t close, though, and I can close the dialogue and keep typing - but it is very annoying.

I run PsychoPy 2020.2.4 (the same happens with 2020.2.3) on Mac Catalina 10.15.6
See error message here:

Traceback (most recent call last):
  File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.6/jedi/cache.py”, line 109, in wrapper
KeyError: ((), frozenset())

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File “parso/grammar.pyc”, line 246, in load_grammar
KeyError: ‘/Applications/PsychoPy.app/Contents/Resources/lib/python36.zip/parso/python/grammar36.txt’

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.6/wx/core.py”, line 3383, in <lambda>
  File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.6/psychopy/app/coder/coder.py”, line 837, in ShowAutoCompleteList
  File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.6/jedi/api/__init__.py”, line 185, in __init__
  File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.6/jedi/inference/__init__.py”, line 91, in __init__
  File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.6/jedi/cache.py”, line 111, in wrapper
  File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.6/jedi/api/environment.py”, line 37, in get_grammar
  File “parso/grammar.pyc”, line 260, in load_grammar
  File “parso/grammar.pyc”, line 249, in load_grammar
NotADirectoryError: [Errno 20] Not a directory: 
‘/Applications/PsychoPy.app/Contents/Resources/lib/python36.zip/parso/python/grammar36.txt’

I am stressing out a bit since I am hosting a PsychoPy intro course from Wednesday morning sept 30th 2020 with 60 students and several of them have contacted me with similar issues on Mac. I have tried to install older versions of PsychoPy, but they do not seem to run on Catalina and I get all kinds of fatal errors already during installation.

1 Like

I see the same thing. It can be triggered just by typing:

print(

in a new Coder document.

As a workaround, could you try going to PsychoPy’s Preferences menu, clicking the “Application” icon, scroll down to “Coder”, and de-select “Auto complete”? This fixed the issue for me, but please let us know if it does or does not work for you.

@jon: already seems to have picked this up as an issue:

2 Likes

Great! Thanks Michael for the quick response. This solved it for me :slight_smile: