URL of code: eval_pointing_1
Description of issue:
I am trying to export my experiment to HTML, and it fails every time I use a variable-defined condition file in one of my trial loops. This is used to randomize conditions.
Earlier in the experiment I define a config file by variable in a practice trial loop, and that causes no issues. Both config file name variables are declared in the same place - right at the start of the experiment.
I have verified that this is the cause of the issue by hard-coding one of the two config files in the loop. PsychoPy will then export to HTML and the experiment runs fine.
I could workaround this, but this will take a lot of effort to implement, so I am hoping there is a way to resolve this export error.
Appreciate any help!
Stdout of the Export to HTML below
pygame 1.9.6
Hello from the pygame community. Contribute - pygame wiki
6.9069 WARNING We strongly recommend you activate the PTB sound engine in PsychoPy prefs as the preferred audio engine. Its timing is vastly superior. Your prefs are currently set to use [‘sounddevice’, ‘PTB’, ‘pyo’, ‘pygame’] (in that order).
7.7128 WARNING duplicate variable names: inst_panel
Alert 4051: Experiment was built in a future version of PsychoPy (2021.1.4), we recommend either updating PsychoPy or changing the “Use Version” setting in Experiment Settings to this version.
For more info see https://docs.psychopy.org/alerts/4051.htmlTraceback (most recent call last):
File “C:\Users\Vision Lab\AppData\Roaming\psychopy3\versions\psychopy\experiment_experiment.py”, line 816, in findPathsInFile
filePath = eval(filePath)
File “”, line 1, in
NameError: name ‘block_config_csv’ is not defined
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “C:\Program Files\PsychoPy3\lib\runpy.py”, line 193, in _run_module_as_main
“main”, mod_spec)
File “C:\Program Files\PsychoPy3\lib\runpy.py”, line 85, in _run_code
exec(code, run_globals)
File “C:\Program Files\PsychoPy3\lib\site-packages\psychopy\scripts\psyexpCompile.py”, line 250, in
compileScript(args.infile, args.version, args.outfile)
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:\Users\Vision Lab\AppData\Roaming\psychopy3\versions\psychopy\experiment_experiment.py”, line 220, in writeScript
localDateTime, modular)
File "C:\Users\Vision Lab\AppData\Roaming\psychopy3\versions\psychopy\experiment\components\settings_init.py", line 528, in writeInitCodeJS
self.prepareResourcesJS()
File "C:\Users\Vision Lab\AppData\Roaming\psychopy3\versions\psychopy\experiment\components\settings_init.py", line 516, in prepareResourcesJS
resourceFiles = self.exp.getResourceFiles()
File “C:\Users\Vision Lab\AppData\Roaming\psychopy3\versions\psychopy\experiment_experiment.py”, line 864, in getResourceFiles
condsPaths = findPathsInFile(params[‘conditionsFile’].val)
File “C:\Users\Vision Lab\AppData\Roaming\psychopy3\versions\psychopy\experiment_experiment.py”, line 830, in findPathsInFile
files.extend(findPathsInFile(str(condFile)))
File “C:\Users\Vision Lab\AppData\Roaming\psychopy3\versions\psychopy\experiment_experiment.py”, line 847, in findPathsInFile
conds = data.importConditions(thisFile[‘abs’]) # load the abs path
File “C:\Users\Vision Lab\AppData\Roaming\psychopy3\versions\psychopy\data\utils.py”, line 476, in importConditions
(fileName, len(trialList), len(fieldNames)))
UnboundLocalError: local variable ‘trialList’ referenced before assignment
65565.0625 INFO C:\Program Files\PsychoPy3\python.exe -m psychopy.scripts.psyexpCompile C:\Users\Vision Lab\Development\eval_pointing_1\eval_pointing_1.psyexp -o C:\Users\Vision Lab\Development\eval_pointing_1\html\eval_pointing_1.js -v latest