Issues Implementing PupilLab Core Eyetracker

Hello guys i have a problem:

OS: Windows 11
PsychoPy version : 2022.2.3
Standard Standalone? (y/n): Standalone Builder
What are you trying to achieve?: I’m trying to implement and use PupilLabs Core Eyetracker

What did you try to make it work?: I read the documentation provided by PsychoPy and tested every function and code using MouseTracker (it worked that way), so I’m pretty sure I’m doing something wrong using PupilCore. I tested PupilCore using the DemoScript provided by PsychoPy but got the same error messages (see below).

What specifically went wrong when you tried that?: I set up the eye tracker according to the documentation provided by PupilLabs. PupilCapture is running, and Ports and IP for remote access are configured properly. PupilCore is properly connected to the computer. To start the recording i’m using eyetracker.setRecordingState(True)

But every time I’m getting the following error messages:

Hello from the pygame community. https://www.pygame.org/contribute.html
Error during device creation ....
_addDeviceView: Error adding class. 
Traceback (most recent call last):
  File "C:\Program Files\PsychoPy\lib\site-packages\psychopy\iohub\server.py", line 708, in createNewMonitoredDevice
    dev_data = self.addDeviceToMonitor(dev_cls_name, dev_conf)
  File "C:\Program Files\PsychoPy\lib\site-packages\psychopy\iohub\server.py", line 858, in addDeviceToMonitor
    DeviceClass, dev_cls_name, evt_classes = import_device(dev_mod_pth,
  File "C:\Program Files\PsychoPy\lib\site-packages\psychopy\iohub\devices\__init__.py", line 933, in import_device
    device_class = getattr(module, device_class_name)
AttributeError: module 'psychopy.iohub.devices.eyetracker.hw.pupil_labs.pupil_core' has no attribute 'EyeTracker'
Error during device creation ....
Traceback (most recent call last):
  File "C:\Program Files\PsychoPy\lib\site-packages\psychopy\iohub\server.py", line 708, in createNewMonitoredDevice
    dev_data = self.addDeviceToMonitor(dev_cls_name, dev_conf)
  File "C:\Program Files\PsychoPy\lib\site-packages\psychopy\iohub\server.py", line 858, in addDeviceToMonitor
    DeviceClass, dev_cls_name, evt_classes = import_device(dev_mod_pth,
  File "C:\Program Files\PsychoPy\lib\site-packages\psychopy\iohub\devices\__init__.py", line 933, in import_device
    device_class = getattr(module, device_class_name)
AttributeError: module 'psychopy.iohub.devices.eyetracker.hw.pupil_labs.pupil_core' has no attribute 'EyeTracker'

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 642, in _addDevices
    self.createNewMonitoredDevice(dev_cls_name, dev_conf)
  File "C:\Program Files\PsychoPy\lib\site-packages\psychopy\iohub\server.py", line 721, in createNewMonitoredDevice
    raise ioHubError('Error during device creation ....')
psychopy.iohub.errors.ioHubError: ioHubError:
Args: ('Error during device creation ....',)

The rest of the eye-tracking implementation is done by the Builder by default as followed:

# Setup eyetracking
ioConfig['eyetracker.hw.pupil_labs.pupil_core.EyeTracker'] = {
    'name': 'tracker',
    'runtime_settings': {
        'pupillometry_only': True,
        'surface_name': '',
        'gaze_confidence_threshold': 0.6,
        'pupil_remote': {
            'ip_address': '127.0.0.1',
            'port': 50020.0,
            'timeout_ms': 1000.0,
        },
        'pupil_capture_recording': {
            'enabled': False,
            'location': '',
        }
    }
}

# Setup iohub keyboard
ioConfig['Keyboard'] = dict(use_keymap='psychopy')

ioSession = '1'
if 'session' in expInfo:
    ioSession = str(expInfo['session'])
ioServer = io.launchHubServer(window=win, **ioConfig)
eyetracker = ioServer.getDevice('tracker')

Does anybody know how to fix this problem, I’m now somewhat at a loss. Thanks for any help in advance!

Hi, @Hendrik_G,
Were you able to solve the problem? I’m currently working on a similar experiment and would appreciate some help with it since I’m kind of stuck.
Thanks!

Yes, i talked to the PsychoPy Team and it turned out it was a problem with PsychoPy. It is going to be fixed in an upcoming update! Hopefully soon!

Hi,
I had the same problem and a workaround for me was to download all files in psychopy/psychopy/iohub/devices/eyetracker/hw/pupil_labs/pupil_core at release · psychopy/psychopy · GitHub (for example via DownGit) and copy them to my psychopy installation at /psychopy/iohub/devices/eyetracker/hw/pupil_labs/pupil_core/

Hi @Hendrik_G, @dipc,
Thanks for the info.

I’m currently facing an error that occurs everytime the Psychopy experiment code is run. I think it has to do with the initial Psychopy configuration, not with any specific component. The error is the following:
File “C:\Users\PsychoPy\MemoryMovements_lastrun.py”, line 122, in
logFile = logging.LogFile(filename+‘.log’, level=logging.EXP)
AttributeError: module ‘logging’ has no attribute ‘LogFile’
It makes reference to this code:
#save a log file for detail verbose info
logFile = logging.LogFile(filename+‘.log’, level=logging.EXP)
logging.console.setLevel(logging.WARNING) #this outputs to the screen, not a file

Does anyone know what I might be missing? How can I get in touch with the Psychopy team?

Thanks a lot!

Hi,

Do you have from psychopy import logging in the beginning of you script?

Since this seems to be an unrelated problem, maybe you can open a new thread?