| Reference | Downloads | Github

AttributeError: 'Keyboard' object has no attribute '_buffers'

Hello, I’m building my first experiment with spyder and when I try to call the keyboard response with kb.start()
Python crashes and I get the following error:


I tried to google the error but I coulldn’t find any help.

Thanks in advance!

I was checking the script of and the error seems to refer to this part of the code:

 def start(self):
        """Start recording from this keyboard """
        for buffer in self._buffers.values():

and I don’t understand why this gives me an error

Perhaps best to give us your own relevant code section that leads to the error. i.e. where you define the keyboard and up to line 61.

Also, do you get another warning that says something about the Psychtoolbox library not being available, and that the code will drop down to using the event module instead?

I switched from spyder to the psychopy coder and then it worked well. I don’t know which was the problem, but I think that from now I’ll stay on psychopy.

OK, it sounds like your custom Python installation simply didn’t have the psychtoolbox package installed. Using the PsychoPy standalone app means you don’t have to worry about managing dependencies. But there is nothing to stop you using Spyder as an editor and still running file from the PsychoPy app. For serious work, Spyder will be a much better editor to use than PsychoPy’s Coder view.

1 Like