Problem with `EmotivRecord` in PsychoPy Coder

Hello, I’m encountering an issue while running my experiment related to Emotiv, and I hope someone can help me troubleshoot it. Despite importing EmotivRecord at the beginning of my script and correctly setting up the .emotiv-creds file, I receive the following error message from the PsychoPy Runner:

Traceback (most recent call last):
File “C:\Users\super\OneDrive\Escritorio\Curso 23-24\TFG\Experimentos\”, line 51, in
emotiv_recording = EmotivRecord(win_temporizador, ‘emotiv_recording’)
NameError: name ‘EmotivRecord’ is not defined

My code is:

from psychopy import visual, core, event
from psychopy.hardware.emotiv import *

win_temporizador = visual.Window([1000,800], monitor=“testMonitor”, units=“deg”, color=‘white’)
temporizador = core.CountdownTimer(10)

texto_temporizador = visual.TextStim(win_temporizador, text=“”, color=‘black’, pos=(0, 0), height=1.2)

texto_relajacion = visual.TextStim(win_temporizador, text=“Cierra los ojos y relájate”, color=‘black’, pos=(0, -4), height=0.8)

emotiv_recording = EmotivRecord(win_temporizador, ‘emotiv_recording’)

while temporizador.getTime() > 0:
texto_temporizador.text = str(int(temporizador.getTime()))



Could anyone shed some light on why this error occurs? I’ve double-checked my code, and it seems that everything is in order. Is there something specific I’m missing?

Thank you in advance for any insights or suggestions!

Hi There,

What version of PsychoPy are you running and does interacting with Emotiv from the Builder work OK? (this is to pinpoint if the issue is somewhere in the code or a general problem with PsychoPy interacting with Emotiv).



Thank you for your interest, but I’ve worked with PsychoPy Builder and have already solved the issue. Still, thank you.

Best regards,