Psychopy3 won't run my old script

Hi all,

I’ve newly installed PsychoPy3 to run one of my old scripts. It used to run without any issues on a previous version of PsychoPy (I don’t remember which version it was exactly, but my original script was written in Python2). Now, when I run the script, PsychoPy gives me the following error:

2021-08-11 12:20:56.997 python[12346:38681925] ApplePersistenceIgnoreState: Existing state will not be touched. New state will be written to (null)
Traceback (most recent call last):
  File "/Users/noname/GoogleDrive/Primary/Projects/Stim_presentation/adv.py", line 2, in <module>
    import csv, random, pyxid, glob, sys
  File "/Applications/PsychoPy.app/Contents/Resources/lib/python3.6/pyxid/__init__.py", line 51
    print d.device_name, d.get_next_response()
          ^
SyntaxError: invalid syntax
##### Experiment ended. #####

It seems that the source code is missing a parenthesis around the print statement. Since the error is not from my own script, I am not sure how to properly troubleshoot this. Any ideas?

Hi There,

That looks like it is because the old script is using python 2 syntax for print - which is now invalid.

Python2:

print 'hello world'

Python3:

print('hello world')

You might want to check out some docs on the differences between python 2 and python 3 to avoid any other bumps!

Becca

Thank you Becca! I know I can fix this error by rewriting the print statement in Python3 style. But, I am not feeling comfortable with editing source code directly. Also, when I actually rewrite the print statement (in the source code), the error above is gone, but I get another error from different part of source code.

Traceback (most recent call last):
  File "/Users/noname/GoogleDrive/Primary/Projects/Stim_presentation/adv.py", line 2, in <module>
    import csv, random, pyxid, glob, sys
  File "/Applications/PsychoPy.app/Contents/Resources/lib/python3.6/pyxid/__init__.py", line 3, in <module>
    from pyxid_impl import *
ModuleNotFoundError: No module named 'pyxid_impl'
##### Experiment ended. #####

Clearly I am doing something wrong with the new version of PsychoPy, but I can’t find what that is.

Oh I misunderstood thinking that error was coming from the experiment script! But it is coming from PsychoPy itself? Are you running from standalone ?

Yes, I tried a standalone first, and got this error. Then I uninstalled and then tried brew installation, and got the same error. I’m running it on my Mac 10.15.7.

Hi, I have the exact same problem. Were you able to solve it?

Thanks,
Patrícia Fernandes