| Reference | Downloads | Github

AttributeError: pyo server not created



OS: Win10
PsychoPy version: 1.90.3
Standard Standalone (downloaded/installed just a couple weeks ago)

I have an experiment that I made using the builder that uses a microphone component (here, called Stella_rec). The script worked fine on my old Windows 7 machine, but now I’m trying to run it on my new Dell Windows 10 machine, which has never been connected to the Internet. The experiment initializes, but it closes right before the routine with the microphone component and gives this error:

File “D:\GoogleDriveCurrent\Current\RESEARCH\RATE\RateSali\”, line 489, in
Stella_rec = microphone.AdvAudioCapture(name=‘Stella_rec’, saveDir=wavDirName, stereo=False)
File “C:\Program Files (x86)\PsychoPy2\lib\site-packages\psychopy\”, line 381, in init
buffering=buffering, chnl=chnl, stereo=stereo)
File “C:\Program Files (x86)\PsychoPy2\lib\site-packages\psychopy\”, line 170, in init
raise AttributeError(‘pyo server not created’)
AttributeError: pyo server not created

On my Windows 7 machine, I get the same error if I remove pyo from the audio library field in the PsychoPy preferences window. Lines 168-170 in appear to be checking if there is a pyo server:

    # pyo server good to go?
    if not pyo.serverCreated():
        raise AttributeError('pyo server not created')

I can’t find a pyo library on either of my machines, so I don’t know what to fix so that a pyo server can be created.


I am getting the same error. I am just trying to run the demo on Win7 with the newest version (3.0.0b11) but it says AttributeError: pyo server not created. I am trying to use a usb microphone but I’m not sure if I need to tell PsychoPy where the mic is or something. The code works fine on my laptop using the built in mic but it seems like on my desktop it doesn’t know that a mic is plugged in. Anyone know how to tell it where the mic is?


Try changing the audio settings on the computer – Control Panel > Sound > Recording tab > click on desired mic > set as default – and make sure it’s receiving sound (the green bar moves). In the end, I used a different mic – I don’t know if its drivers didn’t play well with PsychoPy or what, but that did it.


I get the same error from running the following lines in the Coder, and changing the default recording device doesn’t solve the problem for me:

from psychopy import microphone
import os

wavDirName = 'Test_wav'
if not os.path.isdir(wavDirName):
    os.makedirs(wavDirName) # make folder to hold .wav files

my_microphone = microphone.AudioCapture(saveDir=wavDirName)

The error is:

  File "C:\Program Files (x86)\PsychoPy3\lib\site-packages\psychopy\", line 170, in __init__
    raise AttributeError('pyo server not created')

Are there any other ways to solve this problem?