When I change “thisExp” to “psychoJS.experiment” one by one in my custom code and sync, until a certain point ı can sync. But after a while when click Sync, I receive this error:
Traceback (most recent call last):
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\app\builder\builder.py”, line 1344, in onPavloviaSync
self.fileExport(htmlPath=htmlPath)
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\app\builder\builder.py”, line 793, in fileExport
target=“PsychoJS”)
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\scripts\psyexpCompile.py”, line 74, in generateScript
compileScript(infile=exp, version=None, outfile=filename)
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\scripts\psyexpCompile.py”, line 247, in compileScript
_makeTarget(thisExp, outfile, targetOutput)
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\scripts\psyexpCompile.py”, line 219, in _makeTarget
script = thisExp.writeScript(outfile, target=targetOutput, modular=True)
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\experiment_experiment.py”, line 254, in writeScript
self_copy.flow.writeFlowSchedulerJS(script)
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\experiment\flow.py”, line 309, in writeFlowSchedulerJS
resourceFiles = set([resource[‘rel’].replace("\", “/”) for resource in self.exp.getResourceFiles()])
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\experiment_experiment.py”, line 888, in getResourceFiles
thisFile = getPaths(thisParam.val)
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\experiment_experiment.py”, line 815, in getPaths
if os.path.isfile(thisFile[‘abs’]):
File “C:\Program Files\PsychoPy\lib\genericpath.py”, line 30, in isfile
st = os.stat(path)
ValueError: stat: path too long for Windows
You shouldn’t get thisExp is not defined any more in 2021.2.3 if you make an edit to the Python side of an auto component (which will encourage the translation to rerun).
However, I think that the most likely reason for your stat path too long error is the location of your experiment file. Is it in it’s own folder or is it, perhaps, in My Documents with lots of sub folders, all of which you are therefore asking PsychoPy to upload to Pavlovia?
I compiled the JS code and replaced all thisExp with psychoJS.experiment and sync only the JS document (not from builder view) now I am not receiving this error. I think this is not a valid solution.
But I need to figure out why I receive ValueError: stat: path too long for Windows
My experiment document is on the desktop and it only includes my experiment files.
Traceback (most recent call last):
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\app\builder\builder.py”, line 1344, in onPavloviaSync
self.fileExport(htmlPath=htmlPath)
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\app\builder\builder.py”, line 793, in fileExport
target=“PsychoJS”)
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\scripts\psyexpCompile.py”, line 74, in generateScript
compileScript(infile=exp, version=None, outfile=filename)
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\scripts\psyexpCompile.py”, line 247, in compileScript
_makeTarget(thisExp, outfile, targetOutput)
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\scripts\psyexpCompile.py”, line 219, in _makeTarget
script = thisExp.writeScript(outfile, target=targetOutput, modular=True)
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\experiment_experiment.py”, line 254, in writeScript
self_copy.flow.writeFlowSchedulerJS(script)
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\experiment\flow.py”, line 309, in writeFlowSchedulerJS
resourceFiles = set([resource[‘rel’].replace("\", “/”) for resource in self.exp.getResourceFiles()])
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\experiment_experiment.py”, line 888, in getResourceFiles
thisFile = getPaths(thisParam.val)
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\experiment_experiment.py”, line 815, in getPaths
if os.path.isfile(thisFile[‘abs’]):
File “C:\Program Files\PsychoPy\lib\genericpath.py”, line 30, in isfile
st = os.stat(path)
ValueError: stat: path too long for Windows
I think that the error message may simply be a result of invalid code.
Please could you add me as a Developer on your study (see my crib sheet for how to do this and unprotect the master branch) and also send me your latest psyexp file via private message
Yes, I have nested if statements however I do not know how to simplfy because it was so hard for me to even create this one. Your help is much appreciated.