Dear developers,
This week, I created a new task in using PsychoPy Builder 2021.1.1 installed using Anaconda on Windows 10. It was working fine on my local machine.
Sometime between then and now, I updated the packages in my Anaconda environment and inadvertently updated psychopy to version 2021.1.3. When I saw this, I immediately downgraded back to psychopy 2021.1.1. When I went to work on my script today, I kept getting the following error message whenever I try to run the same task. I also tried creating an entirely new task (i.e., File > New) and tested whether it would run using one routine with (1) a text component, (2) a text and keyboard component, but get the same error message. I will include the full output.
pygame 2.0.1 (SDL 2.0.14, Python 3.6.13)
Hello from the pygame community. https://www.pygame.org/contribute.html
Error in function KbQueueCreate: Incorrect argument type supplied
Discrepancy between a specified and supplied argument:
Specified Argument Description:
direction: Input
position: 6
presence:
formats allowed:
unclassified
minimum M: 1
maximum M: 1
minimum N: 1
maximum N: 1
minimum P: 1
maximum P: 1
Provided Argument Description:
direction: Input
position: 6
presence: present
format: int32
number of dimensions: 0
M: 1
N: 1
P: 1
PsychHID:KbQueueCreate: Usage:
PsychHID('KbQueueCreate', [deviceNumber][, keyFlags=all][, numValuators=0][, numSlots=10000][, flags=0][, windowHandle=0])
Traceback (most recent call last):
File "multioutcome-psl-behav_lastrun.py", line 81, in <module>
defaultKeyboard = keyboard.Keyboard()
File "C:\Users\Shawn\.conda\envs\lsantasks\lib\site-packages\psychopy\hardware\keyboard.py", line 166, in __init__
buffer = _keyBuffers.getBuffer(devId, bufferSize)
File "C:\Users\Shawn\.conda\envs\lsantasks\lib\site-packages\psychopy\hardware\keyboard.py", line 356, in getBuffer
kb_id=kb_id)
File "C:\Users\Shawn\.conda\envs\lsantasks\lib\site-packages\psychopy\hardware\keyboard.py", line 395, in __init__
self.dev = hid.Keyboard() # a PTB keyboard object
File "C:\Users\Shawn\.conda\envs\lsantasks\lib\site-packages\psychtoolbox\hid.py", line 137, in __init__
self._create_queue(buffer_size)
File "C:\Users\Shawn\.conda\envs\lsantasks\lib\site-packages\psychtoolbox\hid.py", line 145, in _create_queue
None, 0, num_slots, flags, win_handle)
TypeError: Incorrect argument type supplied
0.2668 WARNING We strongly recommend you activate the PTB sound engine in PsychoPy prefs as the preferred audio engine. Its timing is vastly superior. Your prefs are currently set to use ['sounddevice', 'PTB', 'pyo', 'pygame'] (in that order).
I have tried troubleshooting everything I could think of, including removing the Anaconda environment and recreating it from scratch. This is the environment.yml file I have been using:
name: lsantasks
channels:
- conda-forge
dependencies:
- python=3.6
- psychopy=2021.1.1
- pip
- pip:
- psychtoolbox
- pygame
- pyo
- pyparallel; platform_system != "Windows"
- SoundFile; platform_system == "Windows"
- websocket_client
I have a previous version of psychopy (v2020.2.4) in a different Anaconda environment and it can successfully run new tasks without any error.
Please advise on what I can do to fix this issue.
Thanks so much for your help!