[open] Problems with visual.GratingStim
Hi everyone,
I am using a portable version of Open Sesame with psycho back-end, and it doesn't seem to recognise at all the existence of GratingStim. I've imported visual, and it's drawing circles without any problem, but if I want to use visual.GratingStim it says: "AttributeError: 'module' object has no attribute 'GratingStim'". Alternatively, if I try to import specifically GratingStim from psychopy.visual at the start of the script, it says: "ImportError: cannot import name GratingStim". Is this some sort of bug? I'm fairly new to python, and I can't figure out what's going wrong... Any ideas would be appreciated.
Thank you!
Comments
Hi Ananas,
First of all you can test whether the the method
GratingStimis included in thevisualmodule. In order to do so, you can try the code below.By way of comparison, this is what I get after running the code (without problems calling visual.Gratingstim() ):
['Aperture', 'BufferImageStim', 'Circle', 'CustomMouse', 'DotStim', 'ElementArrayStim', 'GratingStim', 'ImageStim', 'Line', 'MovieStim', 'PatchStim', 'Polygon', 'RadialStim', 'RatingScale', 'Rect', 'ShapeStim', 'SimpleImageStim', 'TextStim', 'Window', '_BaseVisualStim', '_isValidColor', '_setColor', '_setTexIfNoShaders', 'cos', 'createTexture', 'getMsPerFrame', 'makeRadialMatrix', 'mpl_Path', 'pointInPolygon', 'polygonsOverlap', 'rush', 'sin']If
GratingStimis not among them, I suppose the file visual.py is broke for some reason. You can try to download it anew from here .If it is already present, there has to be another issue.
Eduard