# Error: ImageStim is neither an image nor a video (works locally, not online)

**URL:** <https://discourse.psychopy.org/t/error-imagestim-is-neither-an-image-nor-a-video-works-locally-not-online/30636>\
**Category:** Online experiments\
**Tags:** images\
**Created:** [August 31, 2022, 2:28pm UTC](https://discourse.psychopy.org/t/error-imagestim-is-neither-an-image-nor-a-video-works-locally-not-online/30636 "2022-08-31T14:28:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![lydiabrown123](https://avatars.discourse-cdn.com/v4/letter/l/e495f1/32.png) [@lydiabrown123](https://discourse.psychopy.org/u/lydiabrown123)\
**Post date:** [August 31, 2022, 2:28pm UTC](https://discourse.psychopy.org/t/error-imagestim-is-neither-an-image-nor-a-video-works-locally-not-online/30636/1 "2022-08-31T14:28:25Z")

</div>

**URL of experiment:** [invertedbodiesexp\_cb1\_10 [PsychoPy]](https://run.pavlovia.org/lydiabrown/cb1_10/? __pilotToken=aab3238922bcc25a6f606eb525ffdc56&__ oauthToken=e48799cd11d87a8ef0e349749fb9995deb22cc29b69638a90416282aaf4ec3bf)

**PsychoPy version:** 2022.2.3

**Description of the problem:** I have an experiment, made using the Builder, that runs locally (on my Mac) perfectly fine, but online it won’t display the images.

An image is displayed and a participant presses 1 or 0 to respond to it. In the image component Image is set to $image which refers to an excel sheet with file paths to all the images to be displayed, and it’s on set every repeat. It works locally fine.

I managed to get the experiment online. It goes through the instructions fine. One of the instructions routines displays an image and that works fine (in the Image component for that, Image is set to 1 individual image in the same folder as the experiment, keyboard.jpg).

When it starts the first routine with experimental stimuli, it crashes with the following error message:

 ![Screenshot 2022-08-31 at 3.02.50 pm](https://us1.discourse-cdn.com/flex002/uploads/psychopy/original/3X/7/0/70628ebade3ceec2843943010ff898ce7796e315.png)

The experimental stimuli are stored in folders, rather than in the same folder as the experiment. This is the only difference I can think of compared to the keyboard.jpg image which works. The excel sheet contains file paths to the images.

What’s even more confusing is that yesterday this experiment worked online! The only thing I’ve changed is adding several instruction routines.

Any ideas?

Thank you! Lydia

---

<div class="post-metadata">

**Author:** ![ajus](https://avatars.discourse-cdn.com/v4/letter/a/dc4da7/32.png) [@ajus](https://discourse.psychopy.org/u/ajus)\
**Post date:** [August 31, 2022, 4:15pm UTC](https://discourse.psychopy.org/t/error-imagestim-is-neither-an-image-nor-a-video-works-locally-not-online/30636/2 "2022-08-31T16:15:29Z")

</div>

I suspect you have both a variable “image” and a component “image”. Could that be? Because the error looks like PsychoJS tries to read a whole component with the name “image” where you actually just want it to take the value of a variable called image.

A possible explanation for the introduction of this error by the instruction routines would be that the component “image” is part of these instruction routines.

Hope that helps!

---

<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:** [September 1, 2022, 2:38pm UTC](https://discourse.psychopy.org/t/error-imagestim-is-neither-an-image-nor-a-video-works-locally-not-online/30636/3 "2022-09-01T14:38:13Z")

</div>

**Don’t**  
Use simple terms for variables, since they may already be in use by PsychoPy. Variable names to avoid are: class, core, image, index, Length, list, Object, Number, round, sound, Symbol, t, thisTrial, trials, util, visual.

> **[PsychoPy Python to Javascript crib sheet 2021](https://docs.google.com/document/d/183xmwDgSbnJZHMGf3yWpieV9Bx8y7fOCm3QKkMOOXFQ/edit?usp=sharing)**
>
> PsychoPy version 2021.1.3-2021.2.3Python to JavaScript Crib Sheet Compiled by Wakefield Morys-Carter, Oxford Brookes UniversityPlease share widely and follow Psych\_Stats on twitter. PsychoPy 2021 is a major update with several new features. When...
