psychopy.org | Reference | Downloads | Github

Cannot import local_setup & problem with originPath=-1

Hi,

I built an experiment on a Windows, now I’m trying to run it on a Mac and it gives me this error:

ImportError: cannot import name locale_setup

Someone in the google groups said it would be okay to delete the ‘local_setup’ from the import list if your language setting is English (is this correct?). After I did that, the experiment started running the instructions but would crash when trials were about to start. It outputted this error:

  File "my_path/my_experiment.py", line 944, in <module>
    seed=None, name='trials')
  File "/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/psychopy/data.py", line 773, in __init__
    self.originPath, self.origin = self.getOriginPathAndFile(originPath)
  File "/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/psychopy/data.py", line 633, in getOriginPathAndFile
    if originPath is None or not os.path.isfile(originPath):
  File "genericpath.pyc", line 29, in isfile
TypeError: coercing to Unicode: need string or buffer, int found

If I delete all occurrences of “originPath = -1” from my experiment script, the problem seems to go away. But I’m worried it’ll affect data down the line. Does anyone know if it’s okay to delete it or if there’s a less risky solution? Is the second problem related to the first (import local_setup)?

Thanks,
Victor

Could you please post a minimal example demonstrating the problem? What version of PsychoPy is this? Thanks!