Experiment does not run on Pavlovia

URL of experiment: Experiment [PsychoPy]

Description of the problem: My Experiment runs on PsychoPy without problems, but when I try to run it on Pavlovia it doesn´t run. When I try it on Pilot it just creats a white screen. I have the new PsychoPy 2022 1.2. I tried it several times with new folders, but it never worked. The errors occurs: Failed to load resource: the server responded with a status of 404 () /Hauber/meditation/index.html/lib/psychojs-2022.1.2.js:1
Failed to load resource: the server responded with a status of 404 () psychojs-2022.1.2.css:1
Failed to load resource: the server responded with a status of 404 ()
run.pavlovia.org/:1 Unchecked runtime.lastError: The message port closed before a response was received.

I am really don´t now where the Problem is. Maybe somebody can help me. Thanks in advance.

Katja

For some reason, when I try to go to https://run.pavlovia.org/Hauber/meditation/ I get redirected to https://run.pavlovia.org/Hauber/meditation/index.html/ which isn’t a valid URL so I’m not surprised it isn’t working.

Do you have anything in Experiment Settings / Online / Output Path ?

I don’t know why, but I think the problem is while creating the index.html file.

If I try to export the index.html manually it also gives me this error:

Traceback (most recent call last):
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\app\builder\builder.py”, line 808, in fileExport
self.generateScript(experimentPath=exportPath,
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\scripts\psyexpCompile.py”, line 71, in generateScript
compileScript(infile=exp, version=None, outfile=filename)
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\scripts\psyexpCompile.py”, line 245, in compileScript
_makeTarget(thisExp, outfile, targetOutput)
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\scripts\psyexpCompile.py”, line 217, in makeTarget
script = thisExp.writeScript(outfile, target=targetOutput, modular=True)
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\experiment_experiment.py”, line 286, in writeScript
self_copy.settings.writeInitCodeJS(script, self_copy.psychopyVersion,
File "C:\Program Files\PsychoPy\lib\site-packages\psychopy\experiment\components\settings_init
.py", line 834, in writeInitCodeJS
with open(os.path.join(folder, “index.html”), ‘wb’) as html:
PermissionError: [Errno 13] Permission denied: ‘C:\Users\Katja Hauber\OneDrive\Desktop\Experiment\index.html’

Do you have anything in Experiment Settings / Online / Output Path ?

Try not using a OneDrive

Delete any existing folders called index.html

No, the Output Path is empty.

I tried it without OneDrive, doesn’t change anything.

The “index.html” folder is created by psychopy, inside this folder is also a data called index.html.

this is the new link I tried: https://run.pavlovia.org/Hauber/khexperiment/

while I was trying to fix it with the old link:
https://run.pavlovia.org/Hauber/meditation/index.html

I deleted the index.html folder and put everything which was inside the foulder outside,
now it shows me, that the experiment is initialising…

The behaviour definitely indicates that at some point in the post you’ve had index.html in the output path field in Experiment Settings / Online. That’s the only reason for a folder called index.html to be created. I think you need to try recreating the experiment from your local files after first deleting the hidden .git folder.

I also have the problem that my experiment runs fine on PsychoPy locally, but it does not run online. It never surpasses the screen “initialising the experiment…”. I do not receive any error message, it just does not run. I am using PsychoPy v2022.1.2 on Windows 10 pro, and I tried running the experiment in Mozilla Firefox (with lots of addons) and in Vivaldi (a chromium browser, no addons).
I followed all the suggested steps, with the exception of not deleting a html folder, because I did not have one.
Then I tried again. It created a new project on Pavlovia.org just fine. I set it to “pilot”, then I tried running it from the dashboard and also from the “run online” button in PsychoPy. The browser tab always opens and gets stuck at the initialisation screen.
I was wondering whether this could be because we included additional python libraries via code? (Could be that we’re importing stuff redundantly, because we did so via several code elements at different places in builder.)

import numpy as np  # whole numpy lib is available, prepend 'np.'
from numpy import (sin, cos, tan, log, log10, pi, average,
                   sqrt, std, deg2rad, rad2deg, linspace, asarray)
from numpy.random import random, randint, normal, shuffle, choice as randchoice
import os  # handy system and path functions
import sys  # to get file system encoding

import psychopy.iohub as io
from psychopy.hardware import keyboard

import webbrowser

Any ideas on what I could check to find the bug are welcome!

Python libraries don’t work online, so I tend to avoid them when creating experiments I want to work in both locally and online.

Thanks a lot for sharing. Then I know that we’ll have to work around it.

Is there a list anywhere, which Python libraries are implemented in PsychoPy? I couldn’t find one when searching online.

How do I know which local files are not necessary vs necessary for step 6? Also, would the local Git files be within the psychopy folder? Overall, my issue is that my experiment runs on a browser online and locally, and has been uploaded before to Pavlovia (so I know my JS code is fine) and now is no longer uploading to Pavlovia with only a loading button and no error message.

The only files that are necessary to recreate your experiment are the psyexp file, any spreadsheets and any images/sounds/videos.