psychopy.org | Reference | Downloads | Github

Unable to get hdf5 files and store gaze data

Hi! I am trying to run an eye tracking experiment with the Builder component, but I keep having this issue.

OS (e.g. Win10): Win10
PsychoPy version (e.g. 1.84.x): v2021.2.3
Standard Standalone? (y/n) If not then what?: y
**What are you trying to achieve?:**recording eye movements while watching a stimulus video in Builder

What did you try to make it work?:

What specifically went wrong when you tried that?:
I want to save gaze data as hdf5 files, so I selected the option in the Builder settings. I also properly configured my eye tracker in the same Builder settings (specifying the device, the model name, serial number, etc.). I inserted the calibration routine, the eyetracker record routine and a part of my stimulus video. Whenever I ran the experiment in Builder, I kept getting this error message:

gitpython and a git installation required for getProject()
20.2146 INFO Loaded monitor calibration from [‘2021_12_01 15:33’]
Generating PsychoPy script…

Running: C:\Users\zermianifa\Desktop\experiment\pilot_mw_negative_lastrun.py

25.2035 INFO Loaded monitor calibration from [‘2021_12_01 15:33’]
pygame 1.9.6
Hello from the pygame community. Contribute - pygame wiki
WARNING: pytables package not found. ioHub functionality will be disabled.
Error during device creation …
Traceback (most recent call last):
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\iohub\server.py”, line 667, in createNewMonitoredDevice
dev_data = self.addDeviceToMonitor(dev_cls_name, dev_conf)
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\iohub\server.py”, line 799, in addDeviceToMonitor
_dconf = yload(open(dev_conf_pth, ‘r’), Loader=yLoader)
FileNotFoundError: [Errno 2] No such file or directory: ‘C:\Program Files\PsychoPy\lib\site-packages\psychopy\iohub\devices\datastore_name\default_datastore_name.yaml’
Error during device creation …
Traceback (most recent call last):
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\iohub\server.py”, line 667, in createNewMonitoredDevice
dev_data = self.addDeviceToMonitor(dev_cls_name, dev_conf)
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\iohub\server.py”, line 799, in addDeviceToMonitor
_dconf = yload(open(dev_conf_pth, ‘r’), Loader=yLoader)
FileNotFoundError: [Errno 2] No such file or directory: ‘C:\Program Files\PsychoPy\lib\site-packages\psychopy\iohub\devices\datastore_name\default_datastore_name.yaml’

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\iohub\server.py”, line 601, in _addDevices
self.createNewMonitoredDevice(dev_cls_name, dev_conf)
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\iohub\server.py”, line 680, in createNewMonitoredDevice
raise ioHubError(‘Error during device creation …’)
psychopy.iohub.errors.ioHubError: ioHubError:
Args: (‘Error during device creation …’,)

ioHub Server Process Completed With Code: 0
WARNING: pytables package not found. ioHub functionality will be disabled.
Traceback (most recent call last):
File “C:\Users\zermianifa\Desktop\experiment\pilot_mw_negative_lastrun.py”, line 97, in
ioServer = io.launchHubServer(window=win, experiment_code=‘pilot_mw_negative’, session_code=ioSession, datastore_name=filename, **ioConfig)
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\contrib\lazy_import.py”, line 120, in call
return obj(*args, **kwargs)
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\iohub\client\connect.py”, line 290, in launchHubServer
return ioHubConnection(iohub_config)
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\iohub\client_init_.py”, line 287, in init
self.iohub_status = self.startServer(ioHubConfig, ioHubConfigAbsPath)
File "C:\Program Files\PsychoPy\lib\site-packages\psychopy\iohub\client_init
.py", line 986, in _startServer
self.createDeviceList(ioHubConfig[‘monitor_devices’])
File "C:\Program Files\PsychoPy\lib\site-packages\psychopy\iohub\client_init
.py", line 1012, in _createDeviceList
if device_config.get(‘enable’, True) is True:
AttributeError: ‘str’ object has no attribute ‘get’

Experiment ended.

I fixed this error message by manually change the configuration, meaning that I switched to the Coder component, created a YAML file and changed the configuration lines (I followed the discussion reported here Guidance on using eyetracking with ioHub and YAML files post 2021.2.0).

After this modification, my experiment runs without any error message. However, the data I get are always 3 small files (.csv 1KB, .log 5KB, .psydat 2KB) containing information about the experiment but no gaze data. Note that I tried to print out gaze data following an example code, everything seemed fine. I also used my eye tracker - Tobii Pro Nano - with another software and it is working fine.

I really have no more ideas on how to fix this issue, so I would really appreciate any support or ideas. Thank you very much!

Hi @fzer, I think the root of the issue you are having is from the above warning, which is printed when psychopy can not import the pytables python package that iohub uses to create the hdf5 file. It looks like you installed Psychopy using the Windows standalone installer, so I’m not sure why this error is occurring.

Does the same error occur when you try running one of the included demos, like Featue Demos → eyetracking, when you enable saving the hdf5 file? If so, could you try uninstalling PsychoPy, ensuring the C:\Program Files\PsychoPy folder is deleted after the uninstall, and then reinstall PsychoPy to see if that somehow fixes the issue? On the other hand, if the issue seems specific to your Builder project, please post it.

Thank you

Hi @sol , thanks a lot for your reply.
I properly uninstalled PsychoPy, reinstalled it and ran both my experiment and the eyetracking demo. I still get the same error message in both cases.
Are there other things I could do or check maybe?
Thank you for your support!

Humm, can you confirm the version of Windows you are using? Also, do you have another version of Python 3 installed on the computer? I’m wondering if there is a conflict in your path between another version of the python tables package and the version shipped with PsychoPy.

Sure, I can confirm Windows 10 and yes indeed, I had another version of Python installed on my computer (3.8). I tried to uninstall it (deleted all the folders and directories) and re-run the experiment, but same error message. The only version I have now seems to be: Python 3.6.6, located inside the PsychoPy folder (C:\Program Files\PsychoPy\python.exe).
Thank you