AttributeError: pyo server not booted

939 views
Skip to first unread message

Christina Vu

unread,
Jun 17, 2013, 4:36:03 PM6/17/13
to psychop...@googlegroups.com
Hello, I am running psychopy2 on a windows and I get the AttributeError: pyo server not booted

 Running: C:\Documents and Settings\Administrator\My Documents\My Experiments\Stephanie_ECoG_presentation\stimuli\green&purple_simple_lat\Naming1_lastrun.py 
pyo version 0.6.2 (uses single precision)
portaudio error in Pa_OpenStream: Invalid number of channels
Portaudio error: Invalid number of channels
Server not booted.
The Server must be booted!
5.4960 WARNING Data file, data\1_2013_Jun_17_1334.csv, will be overwritten
Traceback (most recent call last):
  File "C:\Documents and Settings\Administrator\My Documents\My Experiments\Stephanie_ECoG_presentation\stimuli\green&purple_simple_lat\Naming1_lastrun.py", line 276, in <module>
    mic_1 = microphone.AudioCapture(name='mic_1', saveDir=wavDirName)
  File "C:\Program Files\PsychoPy2\lib\site-packages\psychopy-1.76.00-py2.7.egg\psychopy\microphone.py", line 130, in __init__
    raise AttributeError('pyo server not booted')
AttributeError: pyo server not booted

I had the globalerror: pyo not defined before, but switched so that [u'pyo'] was first in the audio preferences.

I've checked multiple threads but haven't found a very clear solution! I've been mainly using the builder, but then using the coder to add a few things here and there. 

Any help would be very much appreciated! Thanks!

Jeremy Gray

unread,
Jun 17, 2013, 5:48:41 PM6/17/13
to psychop...@googlegroups.com
Hi Christina,

I suspect that your sound device is not able to support stereo sound ("portaudio error in Pa_OpenStream: Invalid number of channels"), and PsychoPy is not detecting this situation appropriately. You might try the forthcoming PsychoPy 1.77 release--it might be able to better detect and compensate (no promises!): http://code.google.com/p/psychopy/downloads/list

If 1.77.00 does not work for you, let us know and post the error message.

--Jeremy



--
You received this message because you are subscribed to the Google Groups "psychopy-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to psychopy-user...@googlegroups.com.
To post to this group, send email to psychop...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/psychopy-users/84afd272-663b-46ba-9ba0-06715d167914%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Christina Vu

unread,
Jun 19, 2013, 4:04:13 PM6/19/13
to psychop...@googlegroups.com
Hi Jeremy

After updating to 1.77, here is my new error:

File "D:\Documents and Settings\Sara Szczepanski\Desktop\Naming4\Simon_lastrun.py", line 45, in <module>
    microphone.switchOn()
  File "D:\Program Files\PsychoPy2\lib\site-packages\psychopy-1.77.00-py2.7.egg\psychopy\microphone.py", line 836, in switchOn
    sound.initPyo(rate=sampleRate) #will automatically use duplex=1 and stereo if poss
  File "D:\Program Files\PsychoPy2\lib\site-packages\psychopy-1.77.00-py2.7.egg\psychopy\sound.py", line 583, in initPyo
    maxOutputChnls = pyo.pa_get_output_max_channels(outputID)
AttributeError: 'module' object has no attribute 'pa_get_output_max_channels'

Jeremy Gray

unread,
Jun 19, 2013, 5:38:28 PM6/19/13
to psychop...@googlegroups.com
Hi Christina,

It is now finding pyo, which is good. But the StandAlone comes with an old version of pyo, which is not good. So we either need to package the StandAlone with a newer version of pyo, or tweak the code. It may be possible for you to download a newer version of pyo and move it to the right folder, but I am not sure what folder it should be.

We should be able to fix this pretty easily and hopefully quickly.

--Jeremy


--
You received this message because you are subscribed to the Google Groups "psychopy-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to psychopy-user...@googlegroups.com.
To post to this group, send email to psychop...@googlegroups.com.

Jonathan Peirce

unread,
Jun 20, 2013, 5:02:26 AM6/20/13
to psychop...@googlegroups.com
I'll try and get a new version compiled this morning.
Jon


On 19/06/2013 22:38, Jeremy Gray wrote:
Hi Christina,

It is now finding pyo, which is good. But the StandAlone comes with an old version of pyo, which is not good. So we either need to package the StandAlone with a newer version of pyo, oI'll try and compile a new pyoffr tweak the code. It may be possible for you to download a newer version of pyo and move it to the right folder, but I am not sure what folder it should be.

For more options, visit https://groups.google.com/groups/opt_out.
 
 

-- 
Jonathan Peirce
Nottingham Visual Neuroscience

http://www.peirce.org.uk

This message and any attachment are intended solely for the addressee and may contain confidential information. If you have received this message in error, please send it back to me, and immediately delete it.   Please do not use, copy or disclose the information contained in this message or in any attachment.  Any views or opinions expressed by the author of this email do not necessarily reflect the views of the University of Nottingham.

This message has been checked for viruses but the contents of an attachment may still contain software viruses which could damage your computer system, you are advised to perform your own checks. Email communications with the University of Nottingham may be monitored as permitted by UK legislation.


Christina Vu

unread,
Jun 20, 2013, 4:27:07 PM6/20/13
to psychop...@googlegroups.com
Thank you! was wondering if there were any updates?

jbru...@gmail.com

unread,
Jun 26, 2013, 3:37:24 PM6/26/13
to psychop...@googlegroups.com
I am also interested in the status of the new pyo build for Psychopy. I have upgraded to version 1.77.01 to enable parallel port support on Windows 7 (64-bit - which works!), but am now encountering this pyo error for microphone access.

Best,
Jon

jbru...@gmail.com

unread,
Jul 31, 2013, 6:04:42 PM7/31/13
to psychop...@googlegroups.com
Hello,

I have downloaded PYO version 0.6.6, however I am still running into the same errors seen in previous posts. What version of PYO is currently compatible with PsychoPy 1.77.02? I am happy to install any version and try to link with my local version of PsychoPy.

I tried to hardcode the above problematic lines (maxOutputChnls = pyo.pa_get_output_max_channels(outputID)) with maxOutputChnls = 2 as well as maxInputChnls = 2 to see if that would get past the error. It does move past those lines, but gets stuck on the following line:

Traceback (most recent call last):
  File "C:\Program Files (x86)\PsychoPy2\lib\site-packages\psychopy-1.76.00-py2.7.egg\psychopy\microphone.py", line 845, in switchOn
    sound.initPyo(rate=sampleRate) #will automatically use duplex=1 and stereo if poss
  File "C:\Program Files (x86)\PsychoPy2\lib\site-packages\psychopy-1.76.00-py2.7.egg\psychopy\sound.py", line 616, in initPyo
    pyoSndServer = Server(sr=rate, nchnls=maxChnls, buffersize=buffer)
  File "C:\Program Files (x86)\PsychoPy2\lib\site-packages\pyolib\server.py", line 139, in __init__
    self._server._setDefaultRecPath(os.path.join(os.path.expanduser("~"), "pyo_rec.wav"))
AttributeError: '_pyo.Server' object has no attribute '_setDefaultRecPath'

Thanks in advance for any advice on how to proceed.

Jon

Jeremy Gray

unread,
Jul 31, 2013, 6:57:32 PM7/31/13
to psychop...@googlegroups.com
It looks like you are using PsychoPy v1.76:

File "C:\Program Files (x86)\PsychoPy2\lib\site-packages\psychopy-1.76.00

So I would suggest first trying to update to 1.77. (Downloading pyo will not automatically make it work with the StandAlone version of PsychoPy.)

--Jeremy


jbru...@gmail.com

unread,
Aug 1, 2013, 3:41:14 PM8/1/13
to psychop...@googlegroups.com
Hi Jeremy, 

That's what I thought too, but I know I have updated to the latest version (the actual Builder or Coder view windows say Psychopy 1.77.02). Also, my site-packages/psychopy-1.76.00.egg directory has three other directories inside: psychopy, psychopy-1.76.00 and psychopy-1.77.00 (I've been just updating rather than downloading new standalone versions). I have just assumed that the "psychopy" directory here is pointing to the proper psychopy-1.77.00 directory. Do you think I should uninstall, delete all extra directories and reinstall the latest standalone?

Thanks,
Jon

Jeremy Gray

unread,
Aug 1, 2013, 3:45:10 PM8/1/13
to psychop...@googlegroups.com
in the coder shell, if you type "import pyo; pyo.getVersion()" what does it say? 0,6,2 is older, 0,6,6 is the new version you'll need.

also, please post the exact error message you are getting.


jbru...@gmail.com

unread,
Aug 1, 2013, 4:46:16 PM8/1/13
to psychop...@googlegroups.com
Below are the answers to your questions, and my steps for installing pyo version 0.6.6:

[Original errors with pyo version 0.6.2, running the VoiceCapture demo]
pyo version 0.6.2 (uses single precision)
Traceback (most recent call last):
  File "C:\Users\j119b704\Downloads\PsychoPy2 Demos\voiceCapture\voiceCapture_lastrun.py", line 45, in <module>
    microphone.switchOn()
  File "C:\Program Files (x86)\PsychoPy2\lib\site-packages\psychopy-1.76.00-py2.7.egg\psychopy\microphone.py", line 845, in switchOn
    sound.initPyo(rate=sampleRate) #will automatically use duplex=1 and stereo if poss
  File "C:\Program Files (x86)\PsychoPy2\lib\site-packages\psychopy-1.76.00-py2.7.egg\psychopy\sound.py", line 583, in initPyo
    maxOutputChnls = pyo.pa_get_output_max_channels(outputID)
AttributeError: 'module' object has no attribute 'pa_get_output_max_channels'

I then installed PYO version 0.6.6 from (https://code.google.com/p/pyo/downloads/detail?name=pyo_0.6.6_py2.7_setup.exe&can=2&q=). The installation places the important files (pyo.py, pyolib/) in my main python directory C:\Python27. I copied these files to the PsychoPy site-packages directory (C:\Program Files (x86)\PyschoPy2\lib\site-packages). At this point I received some errors regarding some PYO constants (WITH_EXTERNALS) and (PYO_VERSION) - it appeared that neither were set after installing the new PYO

PyShell in PsychoPy - type some commands!


Python 2.7.3 (default, Apr 10 2012, 23:31:26) [MSC v.1500 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
import pyo
Traceback (most recent call last):
  File "<input>", line 1, in <module>
  File "C:\Program Files (x86)\PsychoPy2\lib\site-packages\pyo.py", line 96, in <module>
    if WITH_EXTERNALS:
NameError: name 'WITH_EXTERNALS' is not defined

I commented out the WITH_EXTERNALS lines in pyo.py which moved the program along to this next error:
PyShell in PsychoPy - type some commands!


Python 2.7.3 (default, Apr 10 2012, 23:31:26) [MSC v.1500 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
import pyo
pyo.getVersion()
Traceback (most recent call last):
  File "<input>", line 1, in <module>
  File "C:\Program Files (x86)\PsychoPy2\lib\site-packages\pyolib\_core.py", line 208, in getVersion
    major, minor, rev = PYO_VERSION.split('.')
NameError: global name 'PYO_VERSION' is not defined

Since I knew I installed version 0.6.6, I added PYO_VERSION='0.6.6' to _core.py and then received the following error (which is the same as running in pyo 0.6.2, running the voiceCapture demo)

 Running: C:\Users\j119b704\Downloads\PsychoPy2 Demos\voiceCapture\voiceCapture_lastrun.py 
pyo version 0.6.2 (uses single precision)
Traceback (most recent call last):
  File "C:\Users\j119b704\Downloads\PsychoPy2 Demos\voiceCapture\voiceCapture_lastrun.py", line 45, in <module>
    microphone.switchOn()
  File "C:\Program Files (x86)\PsychoPy2\lib\site-packages\psychopy-1.76.00-py2.7.egg\psychopy\microphone.py", line 845, in switchOn
    sound.initPyo(rate=sampleRate) #will automatically use duplex=1 and stereo if poss
  File "C:\Program Files (x86)\PsychoPy2\lib\site-packages\psychopy-1.76.00-py2.7.egg\psychopy\sound.py", line 583, in initPyo
    maxOutputChnls = pyo.pa_get_output_max_channels(outputID)
AttributeError: 'module' object has no attribute 'pa_get_output_max_channels'

I am not sure why it still says using pyo version 0.6.2 - I am positive I installed version 0.6.6 (I have a 0.6.6 EGG file in my Python27 directory).

Thanks for your help
Jon

Jeremy Gray

unread,
Aug 1, 2013, 4:57:34 PM8/1/13
to psychop...@googlegroups.com
It really looks like your system is running PsychoPy version 1.76, for whatever reason. This ships with pyo 0.6.2, which is what is giving you the "AttributeError: 'module' object has no attribute 'pa_get_output_max_channels'". If you work out how to do a clean install of 1.77, pyo will be the right version as well. I think that's your best bet. I would not do anything with pyo's code unless you are confident you know what you are doing--I certainly can't help there (esp on Windows). With 1.77 you'll get a bunch of improvements to PsychoPy, plus pyo 0.6.6, plus people on this list can help you. 



Jonathan Peirce

unread,
Aug 2, 2013, 5:23:37 AM8/2/13
to psychop...@googlegroups.com


On 01/08/2013 20:41, jbru...@gmail.com wrote:
> (I've been just updating rather than downloading new standalone versions)
The key to the problem is this part. The patch releases (zip files used
for auto-upadating) just contain new versions of the psychopy code. The
problem you're having is with a dependency and those only get updated if
you fetch a new full standalone. Generally they need updating less often
so this is fine, but occasionally we add a new dependency or have to
upgrade one for a new feature.

You can get the newer standalone at sourceforge (we can't use googlecode
any more for these)
https://sourceforge.net/projects/psychpy/files/?source=navbar

best wishes,
Jon

jbru...@gmail.com

unread,
Aug 2, 2013, 10:45:33 AM8/2/13
to psychop...@googlegroups.com
Thanks Jeremy and Jon! I'll try this out.
Best,
Jon

jbru...@gmail.com

unread,
Aug 2, 2013, 11:16:36 AM8/2/13
to psychop...@googlegroups.com
Update: I uninstalled PsychoPy 1.76.00 (removing patch updates), downloaded / installed PsychoPy 1.78.00 (standalone Windows) and everything worked perfectly. Thanks
Reply all
Reply to author
Forward
0 new messages