Skip to content

BF: Fixed missing references needed for Gazepoint eyetracker plugin#6424

Merged
peircej merged 1 commit intopsychopy:releasefrom
mdcutone:release-bf-iohub-gazepoint
May 1, 2024
Merged

BF: Fixed missing references needed for Gazepoint eyetracker plugin#6424
peircej merged 1 commit intopsychopy:releasefrom
mdcutone:release-bf-iohub-gazepoint

Conversation

@mdcutone
Copy link
Member

Fixes provided by @krishna-raj-sr for the Gazepoint eyetracker plugin.

@peircej peircej merged commit 65fee5c into psychopy:release May 1, 2024
@peircej peircej added the 🐞 bug Issue describes a bug (crash or error) or undefined behavior. label Jul 19, 2024
@krishna-raj-sr
Copy link

krishna-raj-sr commented Jul 23, 2024

After the latest update, the Gazepoint tracker stopped working.

I am not familiar with the structure of the pyschopy projects.

In
psychopy_eyetracker_gazepoint/gazepoint/gp3/default_eyetracker.yaml

Instead of eyetracker.gazepoint.gp3.EyeTracker:
adding
eyetracker.hw.gazepoint.gp3.EyeTracker: in line 1 seems to solve the issue

Essentially reverting this commit Reverted Commit
I have also done a lot of other stuff like deleting the folder from \AppData\Roaming\psychopy3\packages\Python38\site-packages. Removing the plugin and did a pip install. Made sure "GazepointSample" event is present at necessary locations.

@peircej peircej requested a review from TEParsons July 23, 2024 11:50
@peircej
Copy link
Member

peircej commented Jul 23, 2024

Thanks @krishna-raj-sr
Could I just clarify, when you say "After the latest update..." do you mean the last update to the plugin or to the 2024.2.0 version of PsychoPy Standalone?

@krishna-raj-sr
Copy link

krishna-raj-sr commented Jul 25, 2024

@peircej [Ignore the previous response there I was messing up with an existing installation try to get it work] Latest update
I installed Psychopy [StandalonePsychoPy-2024.1.5-win64.exe] on a new machine. Installed the Gazepoint plugin. Set Eyetracker to Gazepoint and try to record using a simple experiment and I received the following error.
Traceback (most recent call last): File "C:\Program Files\PsychoPy\lib\site-packages\psychopy\iohub\client\__init__.py", line 1089, in _addDeviceView dev_import_result = import_device(dev_mod_pth, dev_cls_name) File "C:\Program Files\PsychoPy\lib\site-packages\psychopy\iohub\devices\__init__.py", line 944, in import_device event_class = getattr(event_module, event_class_name) AttributeError: module 'psychopy.iohub.devices.eyetracker.hw.gazepoint.gp3' has no attribute 'GazepointSampleEvent' Traceback (most recent call last): File "D:\EyeTrack\psychopy\test_eyetracker_lastrun.py", line 573, in <module> run( File "D:\EyeTrack\psychopy\test_eyetracker_lastrun.py", line 366, in run etRecord = hardware.eyetracker.EyetrackerControl( File "C:\Program Files\PsychoPy\lib\site-packages\psychopy\hardware\eyetracker.py", line 18, in __init__ self._status = tracker.isRecordingEnabled() AttributeError: 'NoneType' object has no attribute 'isRecordingEnabled' ################# Experiment ended with exit code 1 [pid:7108] #################

Solution was to go to Psychopy C:\Program Files\PsychoPy\Lib\site-packages\psychopy\iohub\devices\eyetracker\hw\gazepoint\ init.py and add GazepointSampleEvent to the file and it worked

import psychopy.logging as logging
try:
    from psychopy_eyetracker_gazepoint.gazepoint.gp3 import (
        __file__,
        EyeTracker, 
        MonocularEyeSampleEvent,
        BinocularEyeSampleEvent, 
        FixationStartEvent,
        FixationEndEvent, 
        SaccadeStartEvent,
        SaccadeEndEvent, 
        BlinkStartEvent,
        BlinkEndEvent,
        GazepointSampleEvent
    )
except (ModuleNotFoundError, ImportError, NameError):
    logging.error(
        "The Gazepoint eyetracker requires package " 
        "'psychopy-eyetracker-gazepoint' to be installed. Please install this "
        "package and restart the session to enable support.")

if __name__ == "__main__":
    pass

Then it worked. I think if I remove the plugin and try installing via pip the eyetracker package then the yaml file needs correction as mentioned in my previous comment. Hope this helps

@TEParsons
Copy link
Contributor

@krishna-raj-sr could you try again in version 2024.2.1? We've substantially changed ioHub imports in 2024.2 - I'm wary of just reverting as it may fix it in 2024.1 but break it in 2024.2

@krishna-raj-sr
Copy link

krishna-raj-sr commented Aug 7, 2024

Uninstalled previous Version. Removed Appdata Psychopy Folder. Installed 2024.2.1 python3.8 version. Installed Gazepoint plugin. But gazepoint is not showing to be selected in the experiment settings in builder. Tried SR Research plugin. It shows up. Same happens with 2024.2.1 python3.10. Any tests to be done please let me know.
image
image

@TEParsons
Copy link
Contributor

Oh, I think I see the problem! This is embarrassing - the code fixing the plugin is pulled in and ready to go, we just needed to push it to PyPi 🤦 I've just published a release so you should be able to just uninstall and reinstall the plugin.

@krishna-raj-sr
Copy link

krishna-raj-sr commented Aug 8, 2024

I had to change two things to get it started.
In psychopy_eyetracker_gazepoint/gazepoint/gp3/default_eyetracker.yaml change
eyetracker.gazepoint.gp3.EyeTracker: to eyetracker.hw.gazepoint.gp3.EyeTracker:
Then
to solve this AttributeError: module 'psychopy.iohub.devices.eyetracker.hw.gazepoint.gp3' has no attribute 'GazepointSampleEvent' Error during device creation ....
Added GazepointSampleEvent to "psychopy\iohub\devices\eyetracker\hw\gazepoint\gp3\__init__.py"
Rest I will check and update soon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🐞 bug Issue describes a bug (crash or error) or undefined behavior.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants