OS Ubuntu 20.04
PsychoPy version 2022.2.5
What are you trying to achieve?: Loading stimuli on Pavlovia experiment
Online experiment cannot find stimuli.
Unfortunately we encountered the following error:\n
when importing condition: /home/johnmcbride/projects/PsychExp/Pavlovia/howflat/training.csv\n
when getting the value of resource: /home/johnmcbride/projects/PsychExp/Pavlovia/howflat/training.csv\n
The problem is that the full path is used, rather than the path within the gitlab repository.
Change the “Conditions” fields in the Loop setttings in Builder, so that the full path is not given, and instead “training.csv” is shown.
I’ve written out all of the above in case it is useful for others.
It seems odd to use the full paths like this as default when using the “Specify file…” button. It means that I end up having to just write out the path myself, so the button is entirely redundant.
I haven’t encountered this issue before, except where the file is upstream from the experiment folder. In your example above, was the psyexp file in the howflat folder? I usually use the Specify File button, except where I’m using variables.
The “.psyexp" and ".csv” files are all in the experiment folder (“howflat”).
Just in case I had made some mistake, I tried doing it again with a new file, and I get the same response.
Maybe it’s something specific to the OS / psychopy version?
did you add the condition-files before saving the experiment? When the experiment is not yet saved, absolute paths are used for condition-files which makes sense. However, the absolute paths are nort reset to relative paths when saving the experiment.
Best wishes Jens
To test Jens’s suggestion, I created a new file, added the condition file to a loop, and saved it. The condition file is listed as the absolute path. I restarted psychopy and loaded the file, and the condition file is still listed as absolute.
I suspect that the problem may be about the order in which the project was synced with Pavlovia. To test this, I created a new folder, started a blank project, and tried to sync with Pavlovia as the first step. After clicking on “Create new project”, I get a Segmentation fault.
ones the path is saved it stays the same unless you tell PsychoPy that the path has changed. Why would saving and reloading the experiment change anything about the path? To change the path from absolute to relative, load the saved experiment and reselect the condition-file from the directory the experiment has been saved to.
Before saving the experiment:
After reloading the experiment and reselect the condition-file that is stored in the same directory as the experiment
After reloading the experiment and reselect the condition-file that is stored in a lower directory as the experiment
PsychoPy will use an absolute path when you have to “navigate” to the condition-file. When the experiment has been saved, PsychoPy opens the experiment directory and uses a relative path.
Best wishes Jens
That did it!
I created a new experiment and saved it first. Then when I used “Specify file” it loaded the relative path.
On a side note, I guess part of the confusion comes from me running psychopy from the bash terminal from the experiment folder (and I am used to working with ipython where it knows the information about the current working directory). I guess this is somewhat atypical of psychopy users, and from talking with Becca yesterday it seems that psychopy works best using Windows (and Mac?), using the standalone Builder version. I’ve noticed quite a few segmentation faults so far, running on Ubuntu, but I haven’t been making note of where they happen. Would it be useful if I started documenting them? If so, where should I send them?