# Unknown Resource for Image and condition files

**URL:** <https://discourse.psychopy.org/t/unknown-resource-for-image-and-condition-files/12823>\
**Category:** Online experiments\
**Created:** [April 28, 2020, 9:13am UTC](https://discourse.psychopy.org/t/unknown-resource-for-image-and-condition-files/12823 "2020-04-28T09:13:12Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Julia\_Landsiedel](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/julia_landsiedel/32/8175_2.png) [@Julia\_Landsiedel](https://discourse.psychopy.org/u/Julia_Landsiedel)\
**Post date:** [April 28, 2020, 9:13am UTC](https://discourse.psychopy.org/t/unknown-resource-for-image-and-condition-files/12823/1 "2020-04-28T09:13:12Z")

</div>

URL of experiment: [https://gitlab.pavlovia.org/JLandsiedel/intexp\_v1](https://gitlab.pavlovia.org/JLandsiedel/intexp_v1) & [https://pavlovia.org/JLandsiedel/intexp\_v1](https://pavlovia.org/JLandsiedel/intexp_v1)

PsychoPy 2020.1

Description of the problem:

Hi all,

Apologies for opening a new topic on this. I have read through most of the previous topics and tried their solutions but it has not help so far.

My problem: After successfully setting up my experiment in PsychoPy, I wanted to set it up online. I am able to compile my experiment, sync with Pavlovia and have added all necessary stimuli and files in the resources folder. I have tried to pilot both locally and online but am not getting very far into the experiment.

Participants should first see an information sheet on the first screen but this does not work at all when piloting locally Unknown resources error for Consent/InfoSheet.png. Online it does not give an error message, however, the image is NOT shown, online a text component, and I am able to switch to the next screen. The next screen would be where participants give consent. When piloting online again, the image Consent/ConsentSheet.png does not show but strangely two symbols Consent/cross\_small.png and Consent/tick\_small.png appear and are clickable. The strange thing about this error is that all of the above stimuli are within the same folder.

If you go to the next page by clicking on the tick it goes to the next page with text instructions. Going on from there gives another resource error for the first demo of a trial:

Unfortunately we encountered the following error:

- when importing condition: /ConfigFilesUnix/R1\_CI1\_IntObservationRando/R1\_CI1\_IntObservationRando\_DEMO.xlsx
- when getting the value of resource: /ConfigFilesUnix/R1\_CI1\_IntObservationRando/R1\_CI1\_IntObservationRando\_DEMO.xlsx
- **unknown resource**

I am pretty certain that the problem is not a typo or missing files. I would greatly appreciate your help as I am out of ideas what else it could be.

Many thanks,  
Julia

---

<div class="post-metadata">

**Author:** ![Julia\_Landsiedel](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/julia_landsiedel/32/8175_2.png) [@Julia\_Landsiedel](https://discourse.psychopy.org/u/Julia_Landsiedel)\
**Post date:** [May 1, 2020, 4:00pm UTC](https://discourse.psychopy.org/t/unknown-resource-for-image-and-condition-files/12823/2 "2020-05-01T16:00:27Z")

</div>

Okay after playing around with things and reading more in the forum I have found the solution to my problems.

The Unknown Resource problem for my consent form was due to the positions which I specified in variables. Once I specified the positions manually in the dialogue box or for other stimuli in my conditions file separately for x and y (see other posts on this), it worked.

It was trickier to resolve the condition file error and it was a combination of clearing my browser cache and other things to make it work.

---

<div class="post-metadata">

**Author:** ![DarynBG](https://avatars.discourse-cdn.com/v4/letter/d/ee59a6/32.png) [@DarynBG](https://discourse.psychopy.org/u/DarynBG)\
**Post date:** [June 22, 2020, 10:16am UTC](https://discourse.psychopy.org/t/unknown-resource-for-image-and-condition-files/12823/3 "2020-06-22T10:16:05Z")

</div>

Thanks for sharing your solution. I am having a similar issue with images and conditions files. Any tips for resolving the condition file error?

---

<div class="post-metadata">

**Author:** ![Julia\_Landsiedel](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/julia_landsiedel/32/8175_2.png) [@Julia\_Landsiedel](https://discourse.psychopy.org/u/Julia_Landsiedel)\
**Post date:** [June 22, 2020, 11:01am UTC](https://discourse.psychopy.org/t/unknown-resource-for-image-and-condition-files/12823/4 "2020-06-22T11:01:43Z")

</div>

It would be useful to know a bit more about how you coded it in order to have an idea what the error might be.

Is it a loop within a loop where you specify the condition file in an inner loop?  
Do you specify the condition file path+filename in the dialogue box or as a variable through a code snippet?  
Have all your resources synced successfully online/did you copy the condition file into the resource folder?

Have you looked at other forum posts which talk about solutions in more detail (below links are just two examples I picked)?

> [@Unknown resource, conditions file](https://discourse.psychopy.org/t/unknown-resource-conditions-file/13700):
>
> URL of experiment: [https://pavlovia.org/snorwood/mts\_1b](https://pavlovia.org/snorwood/mts_1b) Description of the problem: I receive the following error when I try to pilot my experiment. My conditions file is in the resources folder inside the html folder for my experiment. It shows up under files when I view the code online. I can’t figure out the problem. Thanks! Unfortunately we encountered the following error: when importing condition: /Users/temp/Documents/Experiments/html/resources/Conditions\_1B.xlsx when getting the value…

> [@Psychojs - Inner Loop pattern](https://discourse.psychopy.org/t/psychojs-inner-loop-pattern/8087/3):
>
> PS - @dvbridges ; Can you confirm that the solution you listed with cond.xlsx and A.xlsx in [your earlier answer](https://discourse.psychopy.org/t/editing-pavlovia-experiments/7939/27) works in psychojs? I’m able to use a variable as a conditions file name in python, but not online, getting a \<condition\_filename\> is not defined error (I think because of the way the loop is scheduled). If it doesn’t work, can you think of a way to make it? Thank you!

Cheers,  
Julia

---

<div class="post-metadata">

**Author:** ![wakecarter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/wakecarter/32/5753_2.png) [@wakecarter](https://discourse.psychopy.org/u/wakecarter)\
**Post date:** [June 22, 2020, 10:07pm UTC](https://discourse.psychopy.org/t/unknown-resource-for-image-and-condition-files/12823/5 "2020-06-22T22:07:34Z")

</div>

**Don’t:** Use an array in an Excel file for locations or colours.  
**Do:** Use separate variables for x and y coordinates, e.g. $(x,y) or separate r, g, b values for separate colour values.

> **[PsychoPy Python to Javascript crib sheet](https://docs.google.com/document/d/13jp0QAqQeFlYSjeZS0fDInvgaDzBXjGQNe4VNKbbNHQ/edit?usp=sharing)**
>
> PsychoPy version 2020.1.3Python to JavaScript Crib Sheet Compiled by Wakefield Morys-Carter, Oxford Brookes UniversityPlease retweet Psych\_Stats. PsychoPy 2020 has an automatic Python to Javascript translation tool. This document contains...

---

<div class="post-metadata">

**Author:** ![DarynBG](https://avatars.discourse-cdn.com/v4/letter/d/ee59a6/32.png) [@DarynBG](https://discourse.psychopy.org/u/DarynBG)\
**Post date:** [June 23, 2020, 9:43am UTC](https://discourse.psychopy.org/t/unknown-resource-for-image-and-condition-files/12823/6 "2020-06-23T09:43:35Z")

</div>

Thanks for your reply and the links @Julia_Landsiedel. It sounds like we got similar errors but maybe for different reasons. Those cases don’t necessarily apply to my experiment but it is good to know as I troubleshoot.

Thank you @wakecarter, I have been using that sheet and it is super helpful. I don’t think the excel file contents are what is causing my error (no arrays).

---

<div class="post-metadata">

**Author:** ![APW](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/apw/32/12600_2.png) [@APW](https://discourse.psychopy.org/u/APW)\
**Post date:** [December 8, 2020, 9:48am UTC](https://discourse.psychopy.org/t/unknown-resource-for-image-and-condition-files/12823/7 "2020-12-08T09:48:34Z")

</div>

I have adjusted my conditions files and experiment according to the sheet. I don’t use arrays (I do have text stimuli that contain commas - could this derail the experiment somehow?). I checked multiple times for any typos. I am still getting the “Unknown resource” error. Interestingly, it happens only if I try counterbalancing using this:

 ![image](https://us1.discourse-cdn.com/flex002/uploads/psychopy/original/3X/d/b/dbdf913ab2d9e70a21486b2aa9966422f09dbb82.png)  
When I have one of the (very same) conditions files fixed in the loop, it works properly.

Locally, I have also noticed a problem when I type the conditions file name in the loop instead of using the browse function (it does recognise the file from the code above, though). Could this be related somehow?

---

<div class="post-metadata">

**Author:** ![wakecarter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/wakecarter/32/5753_2.png) [@wakecarter](https://discourse.psychopy.org/u/wakecarter)\
**Post date:** [December 8, 2020, 9:58am UTC](https://discourse.psychopy.org/t/unknown-resource-for-image-and-condition-files/12823/8 "2020-12-08T09:58:18Z")

</div>

Unknown resource happens when you specify a resource in code. You need to download them either in the JS code block or from the online tab of the experiment settings.

---

<div class="post-metadata">

**Author:** ![APW](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/apw/32/12600_2.png) [@APW](https://discourse.psychopy.org/u/APW)\
**Post date:** [December 8, 2020, 12:02pm UTC](https://discourse.psychopy.org/t/unknown-resource-for-image-and-condition-files/12823/9 "2020-12-08T12:02:00Z")

</div>

Ah, there. The crucial piece of information that I missed. Thank you!
