NameError in Pavlovia but not Psychopy

URL of experiment: testexp [PsychoPy]

Description of the problem: In psychopy I can assign participants to different conditions either by including a variable in the experiment properties and using that to determine which excel file is used by the trial loop or by including code to randomly pick a condition. However, when I try to upload to Pavlovia I get this error message regardless of which method I have used.

Traceback (most recent call last):
File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.8/psychopy/experiment/_experiment.py”, line 898, in findPathsInFile
File “”, line 1, in
NameError: name ‘expInfo’ is not defined

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.8/psychopy/app/builder/builder.py”, line 1389, in onPavloviaRun
File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.8/psychopy/app/builder/builder.py”, line 804, in fileExport
File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.8/psychopy/scripts/psyexpCompile.py”, line 71, in generateScript
File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.8/psychopy/scripts/psyexpCompile.py”, line 245, in compileScript
File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.8/psychopy/scripts/psyexpCompile.py”, line 217, in _makeTarget
File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.8/psychopy/experiment/_experiment.py”, line 302, in writeScript
File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.8/psychopy/experiment/flow.py”, line 306, in writeFlowSchedulerJS
File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.8/psychopy/experiment/_experiment.py”, line 976, in getResourceFiles
File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.8/psychopy/experiment/_experiment.py”, line 912, in findPathsInFile
File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.8/psychopy/experiment/_experiment.py”, line 929, in findPathsInFile
File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.8/psychopy/data/utils.py”, line 384, in importConditions
File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.8/psychopy/data/utils.py”, line 281, in _assertValidVarNames
psychopy.exceptions.ConditionsImportError: Conditions file /Users/qgdk65/Dropbox/Mac/Documents/Albert, Jonathan, Neusha, Zoe and Maryum,/PARTICIPANT_testexp_2022-01-11_10h24.35.577.xlsx: Parameters (column headers) cannot contain punctuation or spaces

“key_resp_6.keys”

(Sorry for the text. For some reason the screenshot wouldn’t upload.)

It works fine in PsychoJS. Also, I’ve previously used this method in Pavlovia without problems.

Any suggestions will be greatly appreciated.

It seems like you try to import the wrong conditions file. The actual error that caused the exception reads:

File “...”, line 281, in _assertValidVarNames
psychopy.exceptions.ConditionsImportError: Conditions file /Users/.../PARTICIPANT_testexp_2022-01-11_10h24.35.577.xlsx: Parameters (column headers) cannot contain punctuation or spaces

“key_resp_6.keys”

Can you check what file you specified as conditions file in the loop settings?

I checked but I couldn’t see an error. I’ve made the programme from scratch. I still get the NameError without the ImportError. I’ve used code to randomly select the conditions file for the loop.


This all works perfectly in psychopy, but when I sync to Pavlovia I still get the NameError.

Hi

Just my two cents…

I do not know anything about JS but when I ran your function it sometimes it returns a letter (only A) and sometimes (many times actually) it returns nothing.

Also it, the substr seems to have been deprecated so consider using substring instead.

I also find the path below a bit strange with all these commas and spaces

BW
Yiannis