Pyo in Python: name 'Server' not defined

匆匆过客 提交于 2019-12-13 23:28:20

问题


I recently installed Pyo, and I entered Python 3.6 and typed

from pyo import *
s = Server().boot()
s.start()
sf  = SfPlayer("C:\Users\myname\Downloads\wot.mp3", speed=1, loop=True).out()

but I get

Traceback (most recent call last): File "C:\Python27\pyo.py", line 1, in from pyo import * File "C:\Python27\pyo.py", line 2, in s = Server().boot() NameError: name 'Server' is not defined

how do I play the audio file?


回答1:


Your own script is called "pyo.py", so when you do from pyo import * it just looks at your file, not the pyo library. Rename your file.



来源:https://stackoverflow.com/questions/51893964/pyo-in-python-name-server-not-defined

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!