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

Hi, any follow up/resolution from this? I see several other older threads with perhaps a similar ‘pytables package not found’ issue for eyetracking but haven’t found the resolution. I am having the same issue when trying to run either my own script or the eyetracking Feature Demos builder one. (PsychoPy 2022.2.2, standalone install with Python 3.8–no other versions installed, Windows 7). Thanks!

1 Like

Unfortunately, no solution from my side. Hope someone else can help with this.

Testing with the latest release (2022.2.4), I still can not reproduce this issue when running on Windows 10, so I’m not sure what is going on. Do you get any other related error or warning messages printed?

Thanks for looking into this. I just tried on a different machine running Windows 10 (same psychopy version though-- 2022.2.2) and same result. No other errors from the Runner window but I get this message when trying to import tables from the command line.

Seems like one possibility for this apparent issue with numexpr may be related to a MKL dependency with numpy, for which some have redownloaded different versions of numpy+MKL. I think this post be relevant.

I’m getting this pytables load error on two computers. One has no other errors (except a monitor warning) but the other has the DLL warning below that may be related, although I’m not sure why it wouldn’t come up on both machines if it was the same underlying issue.
C:\Program Files\PsychoPy\lib\site-packages\numpy\_distributor_init.py:30: UserWarning: loaded more than 1 DLL from .libs:

Now trying to figure out how to address the DLL issue

Hello,
me and my colleague ar experiencing the same problem. Is there any solution yet?
Cheers!

Hi there, I may have gotten it partially working by just deleting the older of the two DLL files in C:\Program Files\PsychoPy\Lib\site-packages\numpy\.libs\

The eyetracking demo scripts still do not work well for me (e.g. black screen after calibration for builder demo-- sometimes ctrl+alt+delete will advance it), but I think the above DLL step has enabled writing of the hdf5 files. Will be interested to hear if this works for other people.

I was having a similar problem with iohub/pytables/numexpr, and what solved the issue for me to install the 2017 Microsoft Visual C++ Redistributables from here: Latest supported Visual C++ Redistributable downloads | Microsoft Learn .

(Before this fixed the issues, I had tried some other steps - most notably ensuring that psychopy was finding the correct site-packages folder - initially it was picking up pytables from an OS level install of python. Just mentioning this in case you might it helps anyone that might a version conflict.)

1 Like

Hi @ewing,

, I may have gotten it partially working by just deleting the older of the two DLL files in C:\Program Files\PsychoPy\Lib\site-packages\numpy\.libs\

My install of standalone PsychoPy 2022.2.4 only has one dll file in that folder. I wonder if the other file was from a previous version of psychopy that did not fully uninstall?

Thanks for reporting your progress

Thanks, yes seems likely to be a holdover file from an old install, although I had run the uninstall before downloading new version.

In any case, I think perhaps this DLL duplicate issue does not totally fix the issue after all. I now have only that single numpy DLL in my path but am still getting the original error I included above in this thread when trying import tables or import numexpr from the command line. I’ll see if I can try the solution offered by @tyhayeswbs (thanks!), in my case the filepaths all point to the PsychoPy versions of these packages.

Could this be another solution?

I’ll see if I can try the solution offered by @tyhayeswbs

Did this end up helping any?

Since the tables package seems to work in standalone installer on many win10 systems, I would be suprised is this would fix the issue, unless maybe you do still have path conflicts going on.

Thanks, I don’t have admin access to the computers and have not been able to test the C++ Redistributables install yet, although I’ll check to see if it worked for others who seem to be having this same issue. Seems like a good bet though because I checked and appear to have the 2010 version of Microsoft Visual C++ Redistributable.