psychopy.org | Reference | Downloads | Github

Can't generating PsychoJS

I made a simple demo of reaction with keyboard and mouse, but it could not generating into js.
the project is https://gitlab.pavlovia.org/pyl8128/test2.
the error as follow:

Generating PsychoJS script…
Traceback (most recent call last):
File “E:\psychopy\lib\site-packages\psychopy\app\builder\builder.py”, line 2437, in generateScript
psyexpCompile.compileScript(infile=self.exp, version=None, outfile=experimentPath)
File “E:\psychopy\lib\site-packages\psychopy\scripts\psyexpCompile.py”, line 188, in compileScript
makeTarget(thisExp, outfile, targetOutput)
File “E:\psychopy\lib\site-packages\psychopy\scripts\psyexpCompile.py”, line 160, in makeTarget
script = thisExp.writeScript(outfile, target=targetOutput, modular=True)
File “E:\psychopy\lib\site-packages\psychopy\experiment_experiment.py”, line 216, in writeScript
localDateTime, modular)
File "E:\psychopy\lib\site-packages\psychopy\experiment\components\settings_init
.py", line 529, in writeInitCodeJS
self.prepareResourcesJS()
File "E:\psychopy\lib\site-packages\psychopy\experiment\components\settings_init
.py", line 518, in prepareResourcesJS
resourceFiles = self.exp.getResourceFiles()
File “E:\psychopy\lib\site-packages\psychopy\experiment_experiment.py”, line 817, in getResourceFiles
condsPaths = findPathsInFile(params[‘conditionsFile’].val)
File “E:\psychopy\lib\site-packages\psychopy\experiment_experiment.py”, line 796, in findPathsInFile
conds = data.importConditions(thisFile[‘abs’]) # load the abs path
File “E:\psychopy\lib\site-packages\psychopy\data\utils.py”, line 276, in importConditions
trialsArr = pd.read_csv(fileName, encoding=‘utf-8-sig’)
File “E:\psychopy\lib\site-packages\pandas\io\parsers.py”, line 678, in parser_f
return _read(filepath_or_buffer, kwds)
File “E:\psychopy\lib\site-packages\pandas\io\parsers.py”, line 440, in _read
parser = TextFileReader(filepath_or_buffer, **kwds)
File “E:\psychopy\lib\site-packages\pandas\io\parsers.py”, line 787, in init
self._make_engine(self.engine)
File “E:\psychopy\lib\site-packages\pandas\io\parsers.py”, line 1014, in _make_engine
self._engine = CParserWrapper(self.f, **self.options)
File “E:\psychopy\lib\site-packages\pandas\io\parsers.py”, line 1708, in init
self._reader = parsers.TextReader(src, **kwds)
File “pandas_libs\parsers.pyx”, line 384, in pandas._libs.parsers.TextReader.cinit
File “pandas_libs\parsers.pyx”, line 697, in pandas._libs.parsers.TextReader._setup_parser_source
OSError: Initializing from file failed

Hi @pyl8128, not sure what the issue is exactly, but I believe it is related to a) the path of the conditions file, or b) the format of the conditions file. For a) try browsing to to location of the conditions file in the loop, and selecting the file so the correct path is given, b) try saving the conditions file as an “xlsx” file.

Thanks, ‘xls’ works well.