psychopy.org | Reference | Downloads | Github

Eye tracking script and iohub's demo launchHub.py failed

eyetracking
iohub

#1

Hi there,

I have recently did an upgrade to my testing system (including upgrading from psychopy 1.83 to 1.85.3. Note that I never had this issue on the older 1.83 version.) and the foreseeable nightmare of breaking what was initially working occurred. I can’t quite get my own eye tracking script to work, and that is the case for iohub demos as well. I am getting the following errors from my own script:

QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root'
Error during ioDataStore creation....
<class 'tables.exceptions.NoSuchNodeError'>
NoSuchNodeError('group ``/`` does not have a child named ``data_collection``',)
['  File "/usr/lib/python2.7/dist-packages/psychopy/iohub/server.py", line 506, in __init__\n    self.createDataStoreFile(experiment_datastore_config.get(\'filename\',\'events\')+\'.hdf5\',resultsFilePath,\'a\',experiment_datastore_config)\n',
 '  File "/usr/lib/python2.7/dist-packages/psychopy/iohub/server.py", line 837, in createDataStoreFile\n    self.emrt_file=ioHubpyTablesFile(fileName,folderPath,fmode,ioHubsettings)\n',
 '  File "/usr/lib/python2.7/dist-packages/psychopy/iohub/datastore/__init__.py", line 72, in __init__\n    self.loadTableMappings()\n',
 '  File "/usr/lib/python2.7/dist-packages/psychopy/iohub/datastore/__init__.py", line 137, in loadTableMappings\n    self._buildEventGroupMappingDict()\n',
 '  File "/usr/lib/python2.7/dist-packages/psychopy/iohub/datastore/__init__.py", line 319, in _buildEventGroupMappingDict\n    self._eventGroupMappings[\'KEYBOARD_KEY\']=self.emrtFile.root.data_collection.events.keyboard\n',
 '  File "/home/station1/src/tables/tables/group.py", line 841, in __getattr__\n    return self._f_get_child(name)\n',
 '  File "/home/station1/src/tables/tables/group.py", line 711, in _f_get_child\n    self._g_check_has_child(childname)\n',
 '  File "/home/station1/src/tables/tables/group.py", line 402, in _g_check_has_child\n    % (self._v_pathname, name))\n']
Error during device creation ....
<class 'Xlib.error.DisplayConnectionError'>
DisplayConnectionError()
['  File "/usr/lib/python2.7/dist-packages/psychopy/iohub/server.py", line 520, in __init__\n    self.createNewMonitoredDevice(device_class_name,deviceConfig)\n',
 '  File "/usr/lib/python2.7/dist-packages/psychopy/iohub/server.py", line 662, in createNewMonitoredDevice\n    self._hookManager = pyXHook.HookManager(log_events)\n',
 '  File "/usr/lib/python2.7/dist-packages/psychopy/iohub/devices/pyXHook.py", line 163, in __init__\n    self.local_dpy = display.Display()\n',
 '  File "/home/station1/.local/lib/python2.7/site-packages/Xlib/display.py", line 89, in __init__\n    self.display = _BaseDisplay(display)\n',
 '  File "/home/station1/.local/lib/python2.7/site-packages/Xlib/display.py", line 71, in __init__\n    protocol_display.Display.__init__(self, *args, **keys)\n',
 '  File "/home/station1/.local/lib/python2.7/site-packages/Xlib/protocol/display.py", line 167, in __init__\n    raise error.DisplayConnectionError(self.display_name, r.reason)\n']
<class 'psychopy.iohub.util.exception_tools.ioHubError'>
ioHubError:
Args: ('Error during device creation ....',)

['  File "/usr/lib/python2.7/dist-packages/psychopy/iohub/launchHubProcess.py", line 35, in run\n    s = ioServer(rootScriptPathDir, ioHubConfig)\n',
 '  File "/usr/lib/python2.7/dist-packages/psychopy/iohub/server.py", line 524, in __init__\n    raise ioHubError("Error during device creation ....")\n']
Traceback (most recent call last):
  File "/home/station1/Desktop/Aaron/RSVP/Complex RS/RestingState_Dual_Complex.py", line 304, in <module>
    main(configurationDirectory)
  File "/home/station1/Desktop/Aaron/RSVP/Complex RS/RestingState_Dual_Complex.py", line 293, in main
    runtime=ExperimentRuntime(configurationDirectory, "experiment_config.yaml")    
  File "/usr/lib/python2.7/dist-packages/psychopy/iohub/client/__init__.py", line 1603, in __init__
    self.hub = self._initalizeConfiguration()
  File "/usr/lib/python2.7/dist-packages/psychopy/iohub/client/__init__.py", line 1855, in _initalizeConfiguration
    self.hub = ioHubConnection(None, ioHubConfigAbsPath)
  File "/usr/lib/python2.7/dist-packages/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:

As well as these errors for the launchHub.py script:-

Running testWithNoKwargs Test:
Error during device creation ....
<class 'Xlib.error.DisplayConnectionError'>
DisplayConnectionError()
['  File "/usr/lib/python2.7/dist-packages/psychopy/iohub/server.py", line 520, in __init__\n    self.createNewMonitoredDevice(device_class_name,deviceConfig)\n',
 '  File "/usr/lib/python2.7/dist-packages/psychopy/iohub/server.py", line 662, in createNewMonitoredDevice\n    self._hookManager = pyXHook.HookManager(log_events)\n',
 '  File "/usr/lib/python2.7/dist-packages/psychopy/iohub/devices/pyXHook.py", line 163, in __init__\n    self.local_dpy = display.Display()\n',
 '  File "/home/station1/.local/lib/python2.7/site-packages/Xlib/display.py", line 89, in __init__\n    self.display = _BaseDisplay(display)\n',
 '  File "/home/station1/.local/lib/python2.7/site-packages/Xlib/display.py", line 71, in __init__\n    protocol_display.Display.__init__(self, *args, **keys)\n',
 '  File "/home/station1/.local/lib/python2.7/site-packages/Xlib/protocol/display.py", line 167, in __init__\n    raise error.DisplayConnectionError(self.display_name, r.reason)\n']
<class 'psychopy.iohub.util.exception_tools.ioHubError'>
ioHubError:
Args: ('Error during device creation ....',)

['  File "/usr/lib/python2.7/dist-packages/psychopy/iohub/launchHubProcess.py", line 35, in run\n    s = ioServer(rootScriptPathDir, ioHubConfig)\n',
 '  File "/usr/lib/python2.7/dist-packages/psychopy/iohub/server.py", line 524, in __init__\n    raise ioHubError("Error during device creation ....")\n']
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/psychopy/demos/coder/iohub/launchHub.py", line 159, in <module>
    result = namespace[test]()
  File "/usr/lib/python2.7/dist-packages/psychopy/demos/coder/iohub/launchHub.py", line 28, in testWithNoKwargs
    io = launchHubServer()
  File "/usr/lib/python2.7/dist-packages/psychopy/iohub/client/__init__.py", line 1504, in launchHubServer
    return ioHubConnection(ioConfig)
  File "/usr/lib/python2.7/dist-packages/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:

What went wrong here? Any help would be greatly appreciated!


#2

Hey,
I had a very similar issue recently, using an SMI RED-500 eyetracker. I found some relevant information via the following links:

https://github.com/psychopy/psychopy/issues/1811
https://discourse.psychopy.org/t/smi-eyetracker-iviewxapi/1576

In the end, the LaunchHub demo worked in PsychoPy v 1.85.6, but the builder demo didn’t. However, that was a very simple solution and my bad completely. Apparently I did not use a correct ip-configuration (from the pc’s point of view). You don’t provide this info here, but I assumer you’re using two computers (one for presentation and on for the eyetracker)? Are you able to ping to each from the other?


#3

Hey there,

Thanks for the input, but Matlab worked fine on the testing PC, but not psychopy. So I think the problem shouldn’t be with the IP configuration.


#4

** Update : The eye tracking is now working and the experiment is able to run. But the ioDataStore wasn’t able to produce the ‘events.hdf5’ file at the end with all the experimental data like it was supposed to. I tried to google online and found a couple others having the same problem but with non-psychopy related softwares that work with hdf5 files. All of them pointed down to the issue of having the need to downgrade pytables to version 2.xx due to some compatibility issue. Unfortunately, I can’t quite simply install earlier versions of pytables via pip install due to version incompatibility with various other modules like numpy (as stated in the command prompt). Does anyone have the slightest clue as to how I can fix this?

Latest error: -

Error during ioDataStore creation....
<type 'exceptions.NameError'>
NameError("global name 'openFile' is not defined".)
 File "/usr/lib/python2.7/dist-packages/psychopy/iohub/server.py", line 506, in __init__\n    self.createDataStoreFile(experiment_datastore_config.get(\'filename\',\'events\')+\'.hdf5\',resultsFilePath,\'a\',experiment_datastore_config)\n',
File "/usr/lib/python2.7/dist-packages/psychopy/iohub/server.py", line 837, in createDataStoreFile\n    self.emrt_file=ioHubpyTablesFile(fileName,folderPath,fmode,ioHubsettings)\n',

#5

I ran into the same problem “global name ‘openFile’…”. when I specified the experiment_code and session_code (attribute of launchHubServer)

This was solved by running python pt2to3.py -i filepath_with_the_error (pt2to3 would be at site-packages/tables/Scripts)

However, in my case, I ran into NoSuchNodeError('group ``/`` does not have a child named ``data_collection``',) instead.


#6

Oh yes, thanks so much! Running python pt2to3.py worked for me and fixed the openFile issue!


#7

Glad it helped. Would you provide us (or simply, me) how you get rid of the NoSuchNodeError ?


#8

I think I got this solved. The main cause seemed to be that I had a .hdf5 file in my directory. The error went away as soon as I deleted it. I have no idea why this “corrupted hdf5 file” was generated.