If this template helps then use it. If not then just delete and start from scratch.
OS (e.g. Win10): Ubuntu 18.04
PsychoPy version (e.g. 1.84.x): v3.2.4
Standard Standalone? (y/n) If not then what?: y
What are you trying to achieve?: I want to solve an issue
What did you try to make it work?: I tried to follow the task of the first chapter of the book: Building experiments in PsychoPy. I wanted to simply run the Stroop task.
What specifically went wrong when you tried that?:
Include pasted full error message if possible. “That didn’t work” is not enough information.
This is how anyone can replicate my situation.
In the builder view, create a text stimulus.
Below are the messages that I see:
PsychHID-WARNING: Failed to setup international keyboard handling due to failed input context creation.
PsychHID-WARNING: Only US keyboard layouts will be mapped properly due to this failure for GetChar() et al.
PTB-CRITICAL: In call to PsychSetThreadPriority(): Failed to set new basePriority 2, tweakPriority 1, effective 1 [REALTIME] for thread (nil) provided!
PsychHID: KbQueueStart: Failed to switch to realtime priority [Operation not permitted].
Fatal Python error: (pygame parachute) Segmentation Fault
When I go to the Coder view and read over the code, lines 78-79 are:
#create a default keyboard (e.g. to check for escape)
defaultKeyboard = keyboard.Keyboard()
Then lines 140-142 go:
#check for quit (typically the Esc key)
if endExpNow or defaultKeyboard.getKeys(keyList=[“escape”]):
I figured out that if I just comment out line 79 and then replace “defaultKeyboard.getKeys” attribute with “event.getKeys” it works without any issue.
I don’t understand why should it be done this way. I am frustrated to know that the builder view does not even let me run a simple task.
Let me know if I have missed anything. This is my fifth attempt to work with PsychoPy, and this is certainly not a pleasant experience. I feel like it’s an issue related to psychtoolbox module.
In addition, when I run python 3.6.9(which is the version coupled with PsychoPy) and run the following lines:
from psychopy.hardware import keyboard
defaultkeyboard = keyboard.Keyboard()
Python crashes. What am I MISSING?
*note: Ok. I am using a non US keyboard, so that may be another reason.
I have read https://www.psychopy.org/api/hardware/keyboard.html, so I am aware of the change.
Nonetheless, would there be an option to set event.getKeys() as the default call???