File not found online experiment

OS: Win11
PsychoPy version: 2025.2.4beta

Hi everyone,

I’m using a code chunk at the beginning of the experiment to load a stimulus list (as an xlsx file) corresponding to the participant number using the following Python code:

path = f"lists/lists_participant{expInfo[‘participant’]}.xlsx"

Within the main loop, I pass $path as the conditions file and it works just fine locally. However, when I pilot the experiment in the browser, the following error message appears:

  1. when importing condition: lists/lists_participant1.xlsx
  2. when getting the value of resource: lists/lists_participant1.xlsx
  3. unknown resource

This indicates that it cannot find the file, even though my project is synced with Pavlovia and I can see the folder “lists” containing the correct file on GitLab.

The automatically generated JavaScript code also seems fine since the error message displays the correct path, but it can’t find the file for some reason. The translated code is:

path = lists/lists_participant${expInfo["participant"]}.xlsx;

I tried running the experiment instead of just piloting it, but that gave me the same error. Does someone know how I could fix this?

Thanks!

You need to attach all possible spreadsheets in Experiment Settings / Online / Additional Resources or just the correct one via a code component (resource manager might work in the latest version, I’m not sure).

Thanks! Preparing the resource at the beginning of the experiment did the trick! I don’t need to do it during an ITI because I just need one file per participant, but the same logic also applied to loading it at the beginning of the experiment.