Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Supported by

[open] Problems with visual.GratingStim

edited October 2014 in OpenSesame

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

  • edited 4:28AM

    Hi Ananas,

    First of all you can test whether the the method GratingStim is included in the visual module. In order to do so, you can try the code below.

    from psychopy import visual
    print [method for method in dir(visual) if callable(getattr(visual, method))]
    

    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

    Buy Me A Coffee

Sign In or Register to comment.