# TypeError: unsupported operand type(s) for /: 'tuple' and 'int'

**URL:** <https://discourse.psychopy.org/t/typeerror-unsupported-operand-type-s-for-tuple-and-int/3878>\
**Category:** Builder\
**Created:** [February 3, 2018, 6:23pm UTC](https://discourse.psychopy.org/t/typeerror-unsupported-operand-type-s-for-tuple-and-int/3878 "2018-02-03T18:23:02Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![4d4c](https://avatars.discourse-cdn.com/v4/letter/4/da6949/32.png) [@4d4c](https://discourse.psychopy.org/u/4d4c)\
**Post date:** [February 3, 2018, 6:23pm UTC](https://discourse.psychopy.org/t/typeerror-unsupported-operand-type-s-for-tuple-and-int/3878/1 "2018-02-03T18:23:02Z")

</div>

Hi,

I am currently working on an experiment with a group of people. I created a Psychopy survey in version 1.86.2 on a Windows computer. The survey has a story image presented and after each story image the participant answers 2 questions about the story. The survey works on my computer.

However, on 2 MAC computers using version 1.85.6 the survey does not work and when it runs you are able to get to the image, but then when it goes to the rating scale you get this error message

Running: /Users/andrea/Code/punishment experiment test with correct loop\_lastrun.py  
pyo version 0.8.6 (uses single precision)  
2018-02-02 13:33:54.574 python[5244:366543] ApplePersistenceIgnoreState: Existing state will not be touched. New state will be written to (null)  
Traceback (most recent call last):  
File “/Users/andrea/Code/punishment experiment test with correct loop\_lastrun.py”, line 312, in   
win.flip()  
File “/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/psychopy/visual/window.py”, line 646, in flip  
thisStim.draw()  
File “/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/psychopy/visual/ratingscale.py”, line 1135, in draw  
mouseX, mouseY = self.myMouse.getPos() # norm units  
File “/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/psychopy/event.py”, line 499, in getPos  
lastPosPix = lastPosPix - self.win.size / 2  
TypeError: unsupported operand type(s) for /: ‘tuple’ and ‘int’

If anyone has any idea how to resolve this issue it would be greatly appreciated!

---

<div class="post-metadata">

**Author:** ![langestroop](https://avatars.discourse-cdn.com/v4/letter/l/e9bcb4/32.png) [@langestroop](https://discourse.psychopy.org/u/langestroop)\
**Post date:** [February 3, 2018, 7:56pm UTC](https://discourse.psychopy.org/t/typeerror-unsupported-operand-type-s-for-tuple-and-int/3878/2 "2018-02-03T19:56:35Z")

</div>

I’ve encountered the same problem with a visual rating scale while running an experiment on my Mac.  
I’m with 4d4c, a solution will be greatly appreciated! 😃

---

<div class="post-metadata">

**Author:** ![4d4c](https://avatars.discourse-cdn.com/v4/letter/4/da6949/32.png) [@4d4c](https://discourse.psychopy.org/u/4d4c)\
**Post date:** [February 4, 2018, 2:47pm UTC](https://discourse.psychopy.org/t/typeerror-unsupported-operand-type-s-for-tuple-and-int/3878/3 "2018-02-04T14:47:34Z")

</div>

Update: I updated Psychopy to version 1.85.6 on my Windows computer and the survey works perfectly. It seems to be that the [ratingscale.py](http://ratingscale.py) files are very different on the Windows and Mac versions. Windows is about 300-400 lines of code while the Mac version is over 1000.

---

<div class="post-metadata">

**Author:** ![langestroop](https://avatars.discourse-cdn.com/v4/letter/l/e9bcb4/32.png) [@langestroop](https://discourse.psychopy.org/u/langestroop)\
**Post date:** [February 4, 2018, 3:13pm UTC](https://discourse.psychopy.org/t/typeerror-unsupported-operand-type-s-for-tuple-and-int/3878/4 "2018-02-04T15:13:11Z")

</div>

I’ll try on a Windows computer as well. However, this bug is quite puzzling since the previous version of Psychopy was actually supporting [ratingscale.py](http://ratingscale.py) on Mac without problems.

---

<div class="post-metadata">

**Author:** ![Michael](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/michael/32/16_2.png) [@Michael](https://discourse.psychopy.org/u/Michael)\
**Post date:** [February 6, 2018, 5:48am UTC](https://discourse.psychopy.org/t/typeerror-unsupported-operand-type-s-for-tuple-and-int/3878/5 "2018-02-06T05:48:46Z")

</div>

This is to do with the mouse code, not the rating scale. Searching for error messages is a good place to start when looking for help:

> [@Mouse.py in demos giving TypeError: unsupported operand type(s) for /: 'tuple' and 'int'](https://discourse.psychopy.org/t/mouse-py-in-demos-giving-typeerror-unsupported-operand-type-s-for-tuple-and-int/3112):
>
> Hi all, I was trying to run [mouse.py](http://mouse.py) in demos section of Psychopy. I am using the recent standalone version of Psychopy on MAC OS sierra. Can anyone help me to understand why I am getting following error? Traceback (most recent call last): File "/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/psychopy/demos/coder/input/mouse.py", line 41, in \<module\> mouse\_dX, mouse\_dY = myMouse.getRel() File "/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/psychopy/event.py"…

---

<div class="post-metadata">

**Author:** ![langestroop](https://avatars.discourse-cdn.com/v4/letter/l/e9bcb4/32.png) [@langestroop](https://discourse.psychopy.org/u/langestroop)\
**Post date:** [February 7, 2018, 1:57pm UTC](https://discourse.psychopy.org/t/typeerror-unsupported-operand-type-s-for-tuple-and-int/3878/6 "2018-02-07T13:57:10Z")

</div>

Hi Micheal, many thanks for your help and for the linked post.  
Actually I forgot to post it before, but I solved the problem some days ago by setting _noMouse=True_ in the rating scale function (not surprisingly since, as you mentioned, the problem is mouse-related) 😃  
However, even if the problem has been fixed on 1.85.6 for Windows (as @jon reported in the linked discussion), it seems to be still there in the 1.85.6 for Mac. I’ll keep this version for my current experiment since I don’t need the mouse at all, but I’m considering to “downgrade” to 1.85.4 if necessary.
