PsychoPy unable to create/run project on Pavlovia

URL of experiment: https://gitlab.pavlovia.org/marinova/s21-02-animalnum-comp

Description of the problem: I have a project which runs locally on my computer (and others) perfectly fine, but when I try to run the project on Pavlovia directly from the builder menu, the process hangs for more than 15 mins and never creates the project.

I updated to the new PsychoPy 2021.1.4. I also tried creating the project manually, in a new folder, deleting everything on Pavlovia and uploading again, but the problem persists. When I create the link for the project it throws the error “403”.

When creating the project from PsychoPy (Pavlovia.org–> New) I get this error:

Traceback (most recent call last):
  File "C:\Program Files\PsychoPy3\lib\site-packages\psychopy\app\pavlovia_ui\project.py", line 161, in submitChanges
    self.parent.project = self.project
AttributeError: 'NoneType' object has no attribute 'project'

I would be very thankful if someone can point me to a solution.
All the best,
Mila

Please could you post more of the traceback or other messages (in std out perhaps)? Your error means that your experiment won’t sync and therefore won’t create online files. One issue could be that you have a blank text component (add a space). If not, then you need to look for more error messages.

Hi @wakecarter ,

Thanks for your response. Indeed, there was a leftover empty text component. But even after removing it, when I try to create the project (Builder → Compile Python Script → run online) it still doesn`t create the project and throws this error only (see below). In the local directory, I can see the online files created (lib, git, html, etc.). Yet nothing runs on Pavlovia.

Do you have any other suggestions?
Thank you in advance,
Mila

Traceback (most recent call last):
  File "C:\Program Files\PsychoPy3\lib\site-packages\psychopy\app\runner\runner.py", line 644, in runOnline
    if self.currentProject not in [None, "None", ''] and self.currentFile.suffix == '.psyexp':
AttributeError: 'NoneType' object has no attribute 'suffix'

I managed to wait out on the hanging process and here is what I got:

Traceback (most recent call last):
  File "C:\Program Files\PsychoPy3\lib\site-packages\psychopy\app\builder\builder.py", line 1339, in onPavloviaRun
    self.fileExport(htmlPath=self._getHtmlPath(self.filename))
  File "C:\Program Files\PsychoPy3\lib\site-packages\psychopy\app\builder\builder.py", line 759, 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 265, in writeScript
    self_copy._currentRoutine.writeRoutineBeginCodeJS(script, modular)
  File "C:\Program Files\PsychoPy3\lib\site-packages\psychopy\experiment\routine.py", line 287, in writeRoutineBeginCodeJS
    thisCompon.writeRoutineStartCodeJS(buff)
  File "C:\Program Files\PsychoPy3\lib\site-packages\psychopy\experiment\components\code\__init__.py", line 231, in writeRoutineStartCodeJS
    if len(str(self.params['Begin JS Routine'])) and not self.params['disabled']:
TypeError: __str__ returned non-string (type NoneType)

Here’s some suggestions

Thank you for the suggestion.
This indeed solved that problem :). However, the major issue persists and this is that the experiment still doesn`t upload to Pavlovia.

So I started removing parts of the experiment to see where the chain is broken. Initially, my experiment had 2 outer loops for counterbalancing purposes (see picture). When I removed both loops the experiment uploaded on Pavlovia. When I add just one loop with a counterbalance condition file (referring to other excel files) the same problem appears - the process just hangs there and nothing gets uploaded.

Could it be that the experiment is too complicated to be automatically converted to JS and uploaded to Pavlovia? I am asking this because I am able to compile Python script, but not a JS one.

Any pointers on this issu

e,
Mila

It’s not too complicated but for JS some things have to be done differently.

For example, if the counterbalance loop is the one that stops it compile, what does that look like?

Hi @wakecarter,
First, thanks for your timely responses.

Here is a description of how I have structured these loops. The structure resembles a blocked Latin square design:

  • The MainBlock loop contains an excel file with only 1 column called “ChooseBlock”, where two conditions files are referred to (e.g…, A.xlsx and B.xlsx). These conditions should be randomly chosen at each run.
    -The choose block loop has as a condition file $ChooseBlock.

From there onwards it is a bunch of nested files.

  • When a block is chosen, let’s say A.xlsx it goes to another file A_subconditions.xlsx. Here there are other nested files A1.xlsx and A2.xlsx., which are also randomly chosen.
    -Finally, A1.xlsx and A2.xlsx referred to the last nested files which contain the actual stimuli to be presented A1_stimuli.xlsx and A2_stimuli.xlsx

The smaller loops “training” and “trials” have as condition files the columns (as $) from the A.xlsx or B.xlsx files.

I hope I managed to explain in well,
Best
Mila

Please could you show screenshots of your four loop definitions?

Sure, here they are. Would screenshots of the excel files be needed?

Those all look correct. What you could do is work through the nest by setting the variable conditions as fixed Excel files of the right type to see if you can get one version of the experiment running. It might be that one of your Excel files has an issue.

Thanks a lot for the suggestions! I managed to solve the issue by checking the excel files individually. Apparently, some of them had issues, despite that they looked perfectly fine and had no “blanks”. Creating new files solved the problem.

1 Like