| Reference | Downloads | Github

TypeError: unsupported operand type(s) for *: 'NoneType' and 'float'

OS: Mac 10.15.3
PsychoPy version: 3
Standard Standalone? (y/n) If not then what?:
**What are you trying to achieve?: Visual cueing experiment

I have a png that I manage to get to switch orientations using an Excel file on a loop. Then I add an ISI and somewhere along the line I get this error. Once I have the error, it seems to persist whatever I do. I don’t have any of my own code in the experiment, it’s all just Psychopy.

File “/Applications/”, line 1379, in setOri
setAttribute(self, ‘ori’, newOri, log, operation)
File “/Applications/”, line 141, in setAttribute
setattr(self, attrib, value)
File “/Applications/”, line 32, in set
newValue = self.func(obj, value)
File “/Applications/”, line 1255, in ori
radians = value * 0.017453292519943295
TypeError: unsupported operand type(s) for *: ‘NoneType’ and ‘float’



Somehow your Orientation variable is getting set to None rather than containing a number. Firstly check your conditions file for any blank cells.

Otherwise, try inserting a code component and at relevant points (e.g. in the “begin routine” tab), put something like:


to see what the current value is, and if it meets what you think it should be.

Thank you so much Michael