Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Supported by

OSWeb backend: Error when using CSV-File in loop

Hello,


I tried to use a csv file as input for a loop in an OSWeb experiment. My experiment works for the PsychoPy backend but not for the OSWeb backend.

I have tried using different types of csv files and also chatted with SigmundAI but unfortunately I have not found a solution.

I have attached the experiment-file I used to try to find the error, the last version of the csv-file and a screenshot showing the error message. Could you please help me resolving this error message?


Thanks in advance!


Best

Carla

Comments

  • Hi @CarlaC,

    There are two issues here...

    (1) your task includes a loop but no sequence. You need to include a sequence into your loop, otherwise nothing will happen.

    (2) there is an issue with your csv file. It looks as if you encded it as a CSV UTF-8 file. That actually embeds some hidden characters in the file, such that the first line does not contain "my_text" but "\ufeffmy_text" (it includes a Byte Order Mark (BOM) at the beginning). I opened Excel, input the same data as in your csv but saved it as a CSV (comma separated values) and it then worked.

    I attach my version of your task. You'll see that if you're using my file (my_text2.csv) as the source for the loop, it works fine.

    So, my advice is: create your csv files in Excel and save them as CSV (Comma Separated Values) and not as any of the other CSV formats. This should work.

    Hope this helps,

    Fabrice.

    Buy Me A Coffee

  • Hi @Fab,


    thank you for your reply.

    I tried your version of the experiment and got this error (I used Google Chrome; OpenSesame 4.0 Melodramatic Milgram; my_text2.csv is included):

    Could you please help me with that again?


    Thanks in advance!

    Best,

    Carla

  • Hi @CarlaC,

    This is quite odd. I tried the task I posted above on my computer at home and it worked without any problem (you can see a video screen capture here). Assuming that you did not make any changes to the task and ran it as I uploaded it, the issue can't be with the task per se.

    I wonder whether the issue might be with the browser or operating system (if you're using a Mac, it might be that your browser is set up with different security settings).

    You could also check whether the files in the pool get copied. If your computer has security restrictions that prevent the csv files from being copied properly, or it modifies them, you should be able to see it by inspecting the temporary folder where the task and these files are saved. If you try to run the task, you'll see in your browser's URL field what temporary html file is being run and where it is located. Navigate to that folder and make a search for "pool". This should come up with a folder. For example, on my computer when I run the task it creates a temporary html file in the users's space within the AppData/Local/Temp/ folder. If I search for "pool", I find a folder called "tmp0kbbgs_z.opensesame_pool_45928" inside which I can see that the content of the pool has been copied: my_text.csv and my_text2.csv. Check that they are being copied on your system too. If they are not there, then the task would not run.

    Could you possibly try to run the task on a different computer? If you're using a Mac, maybe try on a PC to see if it makes a difference.

    I opened thellocal html file with three different browsers on my computer (Chrome, Edge and Firefox) and they all exeucted the task correctly.

    It's difficult to pinpoint what the issue you encountered is but my instinct tells me it may have to do with the browser/operating system or the interaction between these and OSWeb rather than with the task itself (since it works fine on both my PCs).

    I'm cc this to @cvanbuck and @sebastiaan in case they could could download csv-opensesame Fab.osexp above and give it a go to see if they can reproduce the error you're getting.

    Best,

    Fabrice.

    Buy Me A Coffee

  • @CarlaC Can you first make sure that you are completely up to date? The automatic updater should recommend updates on Windows. If you're using Mac OS (on which the updater is unfortunately broken), you can update OpenSesame and OSWeb with `conda update opensesame osweb -y`.

  • edited June 2

    Thank you for your responses! @Fab @sebastiaan

    I'm running OpenSesame on Windows 11. I double checked and OpenSesame seemed to be up to date; still, I updated it manually and this did not solve my issues.

    So I tried deinstalling and reinstalling OpenSesame and now it works. So there might have been an issue with updating OpenSesame.

    Best,

    Carla

  • Hello again,

    a small edit to my recent comment @Fab: After deinstalling and reinstalling OpenSesame, my upper problem is fixed; however, I can't open old experiment files anymore (which is actually the bigger problem now 😄). Also, sending the error message does not work. @Fab

    Is there a workaround that avoids needing to install the older version of OpenSesame again to make old experiment files work?

    Best,

    Carla

Sign In or Register to comment.