Error when exporting HTML from Psychopy to Pavlovia

I have been coding my experiment on PsychoPy (using coder view) and then entering that code in builder view so that I can export the HTML to Pavlovia. My code runs perfectly when I run it locally on Psychopy. However, I do not know why I cannot export the HTML. Here is the error message I keep getting whenever I try exporting it:

Traceback (most recent call last):
File “C:\Program Files\PsychoPy3\lib\site-packages\psychopy\app\builder\builder.py”, line 719, in fileExport
target=“PsychoJS”)
File “C:\Program Files\PsychoPy3\lib\site-packages\psychopy\scripts\psyexpCompile.py”, line 73, in generateScript
compileScript(infile=exp, version=None, outfile=filename)
File “C:\Program Files\PsychoPy3\lib\site-packages\psychopy\scripts\psyexpCompile.py”, line 242, in compileScript
_makeTarget(thisExp, outfile, targetOutput)
File “C:\Program Files\PsychoPy3\lib\site-packages\psychopy\scripts\psyexpCompile.py”, line 214, in _makeTarget
script = thisExp.writeScript(outfile, target=targetOutput, modular=True)
File “C:\Program Files\PsychoPy3\lib\site-packages\psychopy\experiment_experiment.py”, line 223, in writeScript
self_copy.flow.writeFlowSchedulerJS(script)
File “C:\Program Files\PsychoPy3\lib\site-packages\psychopy\experiment\flow.py”, line 289, in writeFlowSchedulerJS
resourceFiles = set([resource[‘rel’].replace("\", “/”) for resource in self.exp.getResourceFiles()])
File “C:\Program Files\PsychoPy3\lib\site-packages\psychopy\experiment_experiment.py”, line 867, in getResourceFiles
thisFile = getPaths(thisParam.val)
File “C:\Program Files\PsychoPy3\lib\site-packages\psychopy\experiment_experiment.py”, line 793, in getPaths
if os.path.isfile(thisFile[‘abs’]):
File “C:\Program Files\PsychoPy3\lib\genericpath.py”, line 30, in isfile
st = os.stat(path)
ValueError: stat: path too long for Windows


I am not sure what to make of this error. When I entered the code, I set my code type to ‘Both’ so that my Python code and my JavaScript code are both there but in the two separate code windows. I also followed the Python/JavaScript crib sheet and made modifications accordingly.

Any help/suggestions/advice would be greatly appreciated.

Hi! I’d recommend reposting your question in the Builder category. I do notice something interesting in the error message, namely the part above. Maybe try moving your experiment to a shorter path?

Thank you for the suggestion! I will re-post it to the Builder category. As for moving the experiment to a shorter path, I do not know how to do that. Does that mean I have to move all of my experiment files to a different folder?

That’s my guess yes. For example, if your experiment was in…
C:\this\is\an\extremely\long\and\contrived\path\name\
Try putting it in:
C:\this\is\shorter\