NeuroTechX / EEG-ExPy

EEG Experiments in Python
https://neurotechx.github.io/EEG-ExPy/
BSD 3-Clause "New" or "Revised" License
420 stars 124 forks source link

PsychoPy n170 fails on Windows 10 Pro #150

Open sbastiaens opened 2 years ago

sbastiaens commented 2 years ago

When running n170.present (form visual_n170), PsychoPy freezes and python crashes. The problem was fixed by removing show_instructions(duration). We think that the error comes from the fact that mywin = visual.Window([1600, 900], monitor="testMonitor", units="deg", fullscr=True) is repeated twice and therefore PsychoPy creates two screens which makes it crash.

gbernal commented 2 years ago

Hi,

I'm seeing similar issues when running the n170 experiment, p300, and so on. looking adding break points into the code, the code fails when it goes into mywin = visual.Window([1600, 900], monitor="testMonitor", units="deg", fullscr=True) as mentioned by @sbastiaens I tried commenting out show_instructions(duration) but that didn't fix it for me

This is my setup Windows 10 Python Version: 3.9 Brain Interface Used: Cyton

[2022-01-22 18:39:35.565] [board_logger] [info] openning port \.\COM19 Traceback (most recent call last): File "C:\Users\ExpMachine\Documents\GitHub\eeg-notebooks\tests\00xssvep_run_experiment.py", line 20, in n170.present(duration=record_duration, eeg=eeg_device, save_fn=save_fn) File "c:\users\ExpMachine\documents\github\eeg-notebooks\eegnb\experiments\visual_n170\n170.py", line 37, in present mywin = visual.Window([1600, 900], monitor="testMonitor", units="deg", fullscr=True) File "C:\Users\ExpMachine\miniconda3\envs\eeg-notebooks\lib\site-packages\psychopy\visual\window.py", line 343, in init self.monitor = monitors.Monitor(monitor, autoLog=autoLog) File "C:\Users\ExpMachine\miniconda3\envs\eeg-notebooks\lib\site-packages\psychopy\monitors\calibTools.py", line 127, in init self._loadAll() File "C:\Users\ExpMachine\miniconda3\envs\eeg-notebooks\lib\site-packages\psychopy\monitors\calibTools.py", line 446, in _loadAll self.calibs = json_tricks.load(thisFile, ignore_comments=False, File "C:\Users\ExpMachine\miniconda3\envs\eeg-notebooks\lib\site-packages\json_tricks\nonp.py", line 266, in load return loads(string, preserve_order=preserve_order, ignore_comments=ignore_comments, decompression=decompression, File "C:\Users\ExpMachine\miniconda3\envs\eeg-notebooks\lib\site-packages\json_tricks\nonp.py", line 236, in loads return json_loads(string, object_pairs_hook=hook, **jsonkwargs) File "C:\Users\ExpMachine\miniconda3\envs\eeg-notebooks\lib\json\init.py", line 359, in loads return cls(**kw).decode(s) TypeError: init() got an unexpected keyword argument 'encoding' Exception ignored in: <function Window.del at 0x00000224BE696160> Traceback (most recent call last): File "C:\Users\ExpMachine\miniconda3\envs\eeg-notebooks\lib\site-packages\psychopy\visual\window.py", line 582, in del__ self.close() File "C:\Users\ExpMachine\miniconda3\envs\eeg-notebooks\lib\site-packages\psychopy\visual\window.py", line 2274, in close self.backend.close() # moved here, dereferencing the window prevents AttributeError: 'NoneType' object has no attribute 'close'

gbernal commented 2 years ago

I solved this issue by upgrading psychopy to 2021.2.3

ErikBjare commented 2 years ago

@gbernal Thanks for that, I updated to latest Psychopy in #167 so at least that shouldn't be an issue anymore.

ErikBjare commented 2 years ago

Hey @oreHGA I had to revert that PR, so we're still on an old version of psychopy.

rkakrik commented 2 years ago

Same problem in Arch Linux