Liverpool Hope University Logo

EDP Logo

Frequently Asked Questions

Some suggestions to check in your component properties

  • Check the spatial units used: If for example you are using pixels as the spatial units for text or image components, and your stimulus size is still set to the default spatial unit of height (0.5, 0.5), then 0.5 in this instance this represents half a pixel, whereas in height units this is equivalent to 50% of the screen
  • Check the position of your stimulus: Is it positioned off the screen? In the Position property, does the x or y pos exceed the screen height or width
  • Check your font size: For instructional text the font size is usually best somewhere between 18-24px and the Wrap width should be relative to the screen resolution (e.g, if your screen resoltuion is (1440, 900) your wrap width should not exceed 1440 pixels.)
  • Just tell me what size and spatial units to use!
  • We can't tell you this as it will be different for every experiment and every monitor, although pixels is recommended for most applications of spatial units. For presenting text or image stimuli you should find support in previous literature to determine the presentation size on screen
  1. Right-click on the image (or, on a Mac, control-click)
  2. Choose Properties or Get info
  3. Click the General or More info tab
  4. Use the Image section to see the image dimensions in pixels, or the File section to see the image file size

Check that you have the correct information in the stimulus component. For example if you are using text or image stimuli drawn from a conditions file you should reference your conditions file ensuring that you have

  • used the $ sign to link the text or image component to the conds file
  • referenced the correct column heading name in the conds file following the $ as PsychoPy is case sensitive (importantce of good naming conventions)
  • set the stimulus to set every repeat option from the dropdown e.g. $targetWord --> set every repeat
image that shows the error message KeyError: 'participant'

The likelihood is that you have either renamed the participant field in the experiment info or deleted that field. It must exist AND be all lowercase because the data tab will look for that specific information to create the data file, therefore it can't find it and it crashes. See the How To for Experiment Settings

This type of error is usually caused by a naming conflict. The most common source of naming conflicts in an external file which has been imported to be used in a loop i.e. .xlsx, .csv

Check to make sure that all of the variable names are unique. There can be no repeated variable names anywhere in your experiment, again highlighting the importance of good naing conventions!

  • Have you remembered to specify the file you want to use when setting up the loop?
  • Have you remembered to add the variables preceeded by the $ symbol to your stimuli?
  • Have you set your stimulus to every repeat?

Ensure that the code components where you specify the feedack code is placed AFTER the stimuli on the routine. Some code elements need to be at the beginning of a routine, and some after the stimuli.

If the error message says NameError: name 'xxxx is not defined' (with xxxx replaced by a variable name), this indicates to me that there is a problem with a variable specified in a stimulus component

  • Check that you have used the $ sign to reference the stimulus correctly in the relevant component
  • Check that you have it set to every repeat
  • Check the conditions file to ensure that the column names are spelled correctly there is no space at the end of the column name
  • Check that the file path to your image stimuli is correct in your conditions file. For example if your stimuli are in a stims folder the file path would be stims/imagename.jpg
  • Check that you have the correct file extension e.g. .jpg, .JPEG, .png and remember that PsychoPy uses case sensitivity

Think about the number of stimuli you have in the conditions file, and the nReps you have set. The nReps refers to how many times the conditions file will run. What does it say on the your trial loop on the flow? Your answer will be there!