| Reference | Downloads | Github

setUseShaders generates attributeError

Dear all,

I am using PsychoPy 1.84.2. My code, which worked in a previous version, seems to have broken on a line where I set a shader, or in fact, ask not to use it (if I don’t, grey values are unwantingly manipulated).

It can be reproduced (or at least I can…) in this minimal program:

from psychopy import visual
win = visual.Window([1024,768], colorSpace='rgb255')
S1_stim = visual.ImageStim(win, image="S1.png", pos=(100, 100), units='pix',colorSpace="rgb255")

This raises an error from within the psychopy modules:
AttributeError: ‘ImageStim’ object has no attribute ‘setIm’

The complete traceback is below.

Is this problem known, and if so, is there a workaround?

In case it matters, my benchmark output is below the traceback.

Kind regards,

Peter .

File “…/”, line 4, in
File “C:\Program Files (x86)\PsychoPy2\lib\site-packages\psychopy-1.84.2-py2.7.egg\psychopy\visual\”, line 1142, in setUseShaders
setAttribute(self, ‘useShaders’, value, log) # call attributeSetter
File “C:\Program Files (x86)\PsychoPy2\lib\site-packages\psychopy-1.84.2-py2.7.egg\psychopy\tools\”, line 137, in setAttribute
setattr(self, attrib, value)
File “C:\Program Files (x86)\PsychoPy2\lib\site-packages\psychopy-1.84.2-py2.7.egg\psychopy\tools\”, line 27, in set
newValue = self.func(obj, value)
File “C:\Program Files (x86)\PsychoPy2\lib\site-packages\psychopy-1.84.2-py2.7.egg\psychopy\visual\”, line 1134, in useShaders
self.setIm(self._imName, log=False)
AttributeError: ‘ImageStim’ object has no attribute ‘setIm’

Configuration report

All values seem reasonable (no warnings, but there might still be room for improvement).

Only show suboptimal valuesShow all information

Resources: Contributed benchmarks | On-line documentation | Download PDF manual | Search the user-group archives

Configuration test or setting Version or value Notes
benchmark version 0.1 dots & configuration
full-screen True visual window for drawing
dots_circle 1200
dots_square 1800
available memory 2552.33203125M physical RAM available for configuration test (of 7.9G total)
psychopy 1.84.2 avoid upgrading during an experiment
locale pt_BR.cp1252 can be set in Preferences -> App
python version 2.7.11 (32bit)
wx msw (classic)
pyglet 1.2.4
rush True for high-priority threads
openGL version 4.0.0 - Build
openGL vendor Intel
screen size 1536 x 864
have shaders True
visual sync (refresh) 16.75 ms/frame during the drifting GratingStim
refresh stability (SD) 0.27 ms SD < 0.5 ms is ideal (want low variability)
no dropped frames 0 / 180 during DotStim with 100 random dots
openGL max vertices 1048576
GL_ARB_multitexture True
GL_EXT_framebuffer_object True
GL_ARB_fragment_program True
GL_ARB_shader_objects True
GL_ARB_vertex_shader True
GL_ARB_texture_float True
GL_ARB_texture_non_power_of_two True
pyo 0.8.0
numpy 1.11.0 vector-based (fast) calculations
scipy 0.17.1 scientific / numerical
matplotlib 1.5.1 plotting; fast contains(), overlaps()
platform windowsversion=sys.getwindowsversion(major=6, minor=2, build=9200, platform=2, service_pack=’’)
internet access True for online help, usage statistics, software updates, and google-speech
auto proxy True try to auto-detect a proxy if needed; see Preferences -> Connections
proxy setting – current manual proxy setting from Preferences -> Connections
CPU speed test 0.009 s numpy.std() of 1,000,000 data points
Python packages
PIL 1.1.7
openpyxl 2.3.5
lxml – could not import package lxml
setuptools 22.0.0
pytest 2.9.2
sphinx 1.4.1
psignifit – could not import package psignifit
pyserial 3.1
pp – could not import package pp
pynetstation import ok
labjack – could not import package labjack
pywin32 import ok
winioport – could not import package winioport

This page was auto-generated by the PsychoPy configuration wizard on 2016-11-11, 17:08

1 Like

This is indeed a bug. It can be solved by changing line 1134 in C:\Program Files (x86)\PsychoPy2\lib\site-packages\psychopy-1.84.2-py2.7.egg\psychopy\visual\ from

self.setIm(self._imName, log=False)


self.setImage(self._imName, log=False)

Thanks for the minimal example and extensive report!

1 Like

That’s now fixed in the repository