Troubles in exporting psychopy exp. on pavlovia

Hello everyone,
I am encountering some troubles in exporting my experiment in Pavlovia. It is a quite complex experimental procedure, which works perfecty via Psychopy, but then it gives me the following error if I try to generate the link for the online pilot in Pavlovia. Can anyone please help me in this regard?
Thanks a lot :slight_smile:




Traceback (most recent call last):
  File "C:\Program Files\PsychoPy3\lib\site-packages\psychopy\app\builder\", line 1240, in onPavloviaRun
  File "C:\Program Files\PsychoPy3\lib\site-packages\psychopy\app\builder\", line 719, in fileExport
  File "C:\Program Files\PsychoPy3\lib\site-packages\psychopy\scripts\", line 73, in generateScript
    compileScript(infile=exp, version=None, outfile=filename)
  File "C:\Program Files\PsychoPy3\lib\site-packages\psychopy\scripts\", line 242, in compileScript
    _makeTarget(thisExp, outfile, targetOutput)
  File "C:\Program Files\PsychoPy3\lib\site-packages\psychopy\scripts\", line 214, in _makeTarget
    script = thisExp.writeScript(outfile, target=targetOutput, modular=True)
  File "C:\Program Files\PsychoPy3\lib\site-packages\psychopy\experiment\", line 256, in writeScript
    self_copy.flow.writeLoopHandlerJS(script, modular)
  File "C:\Program Files\PsychoPy3\lib\site-packages\psychopy\experiment\", line 325, in writeLoopHandlerJS
    entry.writeMainCodeJS(script, modular)  # will either be function trialsBegin() or trialsEnd()
  File "C:\Program Files\PsychoPy3\lib\site-packages\psychopy\experiment\", line 610, in writeMainCodeJS
    self.loop.writeLoopStartCodeJS(buff, modular)
  File "C:\Program Files\PsychoPy3\lib\site-packages\psychopy\experiment\", line 197, in writeLoopStartCodeJS
    self.params['Selected rows'])
TypeError: __str__ returned non-string (type NoneType)

ONLINEbeta.psyexp (2.5 MB)

Hey Gianvito,

I reproduced your issue and I suspect it has something to do with loops (given the error message mentions loops all the time). Now, your experiment has quite a lot of those, so it’s a bit hard to pinpoint which one is giving you problems. I can recommend a debug-strategy though: systematically remove parts (i.e. loops) from your experiment, until you can export to HTML. This gives us an idea as to what loop caused the error.

Cheers T

Hi Thomas,
thanks a lot for the answer. I will follow your thoughtful suggestion. Indeed the experiment has quite lots of loops as I am trying to merge a whole experiment into a single file. Anyway, many thanks for your help.
Best wishes,


1 Like