Any successful experience with Tobii in OS X 10.10?

Dear all,
I am trying to run the eye tracker connection demo (in both coder and builder).

I tried both Tobii SDK 3.08 and 3.1 in OS X 10.10.

but they always crash with the error below.
I tested it with two different macs, and

  1. confirmed that tobii python sample (calibration) works properly.
  2. the directory is properly set in preference
Fatal Python error: PyThreadState_Get: no current thread
Traceback (most recent call last):
  File "/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/psychopy/demos/coder/iohub/eyetracking/selectTracker/run.py", line 284, in <module>
    main(configurationDirectory)
  File "/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/psychopy/demos/coder/iohub/eyetracking/selectTracker/run.py", line 273, in main
    runtime=ExperimentRuntime(configurationDirectory, "experiment_config.yaml")    
  File "/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/psychopy/iohub/client/__init__.py", line 1603, in __init__
    self.hub = self._initalizeConfiguration()
  File "/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/psychopy/iohub/client/__init__.py", line 1855, in _initalizeConfiguration
    self.hub = ioHubConnection(None, ioHubConfigAbsPath)
  File "/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/psychopy/iohub/client/__init__.py", line 287, in __init__
    raise RuntimeError("Error starting ioHub server: %s"%(self.iohub_status))
RuntimeError: Error starting ioHub server: ioHub startup timed out. iohub Server startup Failed. startup_read:

There is an issue with permissions and iohub in OSX, or more accurately an issue with OSX in how it handles permissions. You can override it, but I’ve had somewhat mixed results and it looks like you need to re-enable it every time you update psychopy. (Windows and Linux do not have this issue.)

In your system preferences, go to ‘security and privacy’ and then to the ‘privacy’ tab, and in the list on the left choose ‘accessibility’. Drag psychopy into the list of programs from your apps folder, and check it. It should then allow iohub to start up.

Hello Jonathan,
Thank you for your comment,
Unfortunately, it doesn’t works in my macs (both 10.10.5, two laptops and two mac pros)…
Is it possible that the problem is not the psychopy, but the ‘so’ file provided in Tobii SDK?

Can you get iohub to work without the eye-tracker? The error you are getting right now is not eye-tracker specific, it’s just saying that it can’t start an iohub server. Try some of the other iohub demos and see if you get the same error. If so, then the issue is iohub. If not, then it might be something Tobii-specific.

Below is the result of running “selectTracker” demo in Coder of Standalone version of Psychopy 1.84.1.
I added ‘modules’ as paths in Psychopy preferences.

[‘/Research/2016/Empathy_and_Emotional_Flanker/Eye_Tracking/Python/modules’]

Below is the error message.

Running: /Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/psychopy/demos/coder/iohub/eyetracking/selectTracker/run.py

2016-09-27 23:59:33.525 python[73632:2614126] ApplePersistenceIgnoreState: Existing state will not be touched. New state will be written to /var/folders/vh/44ll8l6d7gv6_61nx9vmhrpr0000gn/T/org.psychopy.PsychoPy2.savedState
2016-09-27 23:59:41.731 python[73676:2614660] ApplePersistenceIgnoreState: Existing state will not be touched. New state will be written to /var/folders/vh/44ll8l6d7gv6_61nx9vmhrpr0000gn/T/org.psychopy.PsychoPy2.savedState
Fatal Python error: PyThreadState_Get: no current thread
Traceback (most recent call last):
File “/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/psychopy/demos/coder/iohub/eyetracking/selectTracker/run.py”, line 284, in
main(configurationDirectory)
File “/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/psychopy/demos/coder/iohub/eyetracking/selectTracker/run.py”, line 273, in main
runtime=ExperimentRuntime(configurationDirectory, “experiment_config.yaml”)
File “/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/psychopy/iohub/client/init.py”, line 1603, in init
self.hub = self._initalizeConfiguration()
File “/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/psychopy/iohub/client/init.py”, line 1855, in _initalizeConfiguration
self.hub = ioHubConnection(None, ioHubConfigAbsPath)
File “/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/psychopy/iohub/client/init.py”, line 287, in init
raise RuntimeError(“Error starting ioHub server: %s”%(self.iohub_status))
RuntimeError: Error starting ioHub server: ioHub startup timed out. iohub Server startup Failed. startup_read:

Since, when I remove path, the error message changes like below, I think the issue is something btw, Psychopy and SDK files.

<type ‘exceptions.NameError’>
NameError(“global name ‘TobiiPy’ is not defined”,)
[’ File “/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/psychopy/iohub/devices/eyetracker/hw/tobii/eyetracker.py”, line 74, in init\n EyeTracker._tobii=TobiiTracker(product_id=serial_num,model=model_name)\n’,
’ File “/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/psychopy/iohub/devices/eyetracker/hw/tobii/tobiiclasses.py”, line 257, in init\n TobiiTrackerBrowser.start()\n’,
’ File “/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/psychopy/iohub/devices/eyetracker/hw/tobii/tobiiclasses.py”, line 107, in start\n TobiiPy.init()\n’]
<type ‘exceptions.ImportError’>
ImportError(‘No module named tobii.eye_tracking_io’,)
[’ File “/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/psychopy/iohub/devices/eyetracker/hw/tobii/tobiiclasses.py”, line 39, in \n import tobii.eye_tracking_io as TobiiPy\n’]
Error importing TobiiPsychopyCalibrationGraphics
<type ‘exceptions.ImportError’>
ImportError(‘cannot import name Point2D’,)
[’ File “/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/psychopy/iohub/devices/eyetracker/hw/tobii/eyetracker.py”, line 22, in \n from tobiiCalibrationGraphics import TobiiPsychopyCalibrationGraphics\n’,
’ File “/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/psychopy/iohub/devices/eyetracker/hw/tobii/tobiiCalibrationGraphics.py”, line 24, in \n from . tobiiclasses import Point2D\n’]
Error during runSetupProcedure
<type ‘exceptions.NameError’>
NameError(“global name ‘TobiiPsychopyCalibrationGraphics’ is not defined”,)
[’ File “/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/psychopy/iohub/devices/eyetracker/hw/tobii/eyetracker.py”, line 207, in runSetupProcedure\n genv=TobiiPsychopyCalibrationGraphics(self,screenColor=screenColor)\n’]

Under demos, look in the iohub folder and try running ‘keyboard’, and see if you get the same error about iohub failing to start.

keyboard demo works properly.
besides, the sample python script in SDK also works well.
I think the problem is communication (or access) to dylib or so file from psychopy.

I tried with different mac pro with 10.10.5
I installed macport, and installed psychopy manually.
All other demos works properly.

however, when I run selecttrackers, and select tobii, below error message is shown.

Melchior:selectTracker ERI$ python run.py
/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/psychopy/gui.py:45: wxPyDeprecationWarning: Using deprecated class PySimpleApp. 
  app = wx.PySimpleApp()
2016-09-28 14:35:12.623 Python[45835:686209] ApplePersistenceIgnoreState: Existing state will not be touched. New state will be written to /var/folders/dn/txnqh_1s5fz1l26xfshznry40000gn/T/org.python.python.savedState
/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/psychopy/iohub/util/dialogs.py:24: wxPyDeprecationWarning: Using deprecated class PySimpleApp. 
  ioHubDialog.wxapp = wx.PySimpleApp()
2016-09-28 14:35:17.052 Python[45876:686352] ApplePersistenceIgnoreState: Existing state will not be touched. New state will be written to /var/folders/dn/txnqh_1s5fz1l26xfshznry40000gn/T/org.python.python.savedState
Error occurred during ioServer.start(): 'module' object has no attribute 'run'
<type 'exceptions.AttributeError'>
AttributeError("'module' object has no attribute 'run'",)
['  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/psychopy/iohub/launchHubProcess.py", line 55, in run\n    gevent.run()\n']

It seems the error comes from duplicate python execution.
when I put the compiled version in site-packages directory of macports python directory,
I can use iohub eye tracking examples properly.