Python 导入错误没有名为 pyaudio 的模块
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/28140972/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
ImportError No module named pyaudio
提问by Fahadkalis
I am writing a program in Python on RaspberryPi, But I am getting an error
我正在 RaspberryPi 上用 Python 编写程序,但出现错误
ImportError No module named pyaudio
After that I tried
之后我试过了
git clone http://people.csail.mit.edu/hubert/git/pyaudio.git
but again get another
但再次得到另一个
fatal: destination path 'pyaudio' already exists and is not an empty directory.
Can you please guide me that how do I install PyAudio in RaspberryPi
你能指导我如何在 RaspberryPi 中安装 PyAudio
采纳答案by Fahadkalis
Remove the directory PyAudio which already presen in /home/pi and then try these steps
删除 /home/pi 中已经存在的目录 PyAudio,然后尝试这些步骤
sudo apt-get install git
sudo git clone http://people.csail.mit.edu/hubert/git/pyaudio.git
sudo apt-get install libportaudio0 libportaudio2 libportaudiocpp0 portaudio19-dev
sudo apt-get install python-dev
cd pyaudio
sudo python setup.py install
or also you can try this
或者你也可以试试这个
sudo apt-get install python-pyaudio
let us know if u need more assistance or any other trouble
如果您需要更多帮助或任何其他麻烦,请告诉我们
回答by Duloren
If
如果
sudo apt-get install python-pyaudio
did't work try:
没有工作尝试:
sudo apt-get install python3-pyaudio
回答by sanjay
python -m pip install pyaudio
python -m pip install pyaudio
This command works if you already have pip
installed.
If not, first install pip
and ty
如果您已经pip
安装,则此命令有效。
如果没有,请先安装pip
并ty
回答by Suraj Verma
download suitable version of PyAudio File: https://www.lfd.uci.edu/~gohlke/pythonlibs/#pyaudio
下载合适版本的 PyAudio 文件:https://www.lfd.uci.edu/~gohlke/pythonlibs/#pyaudio
Then Open CMD type : C:\Users\Programs\Python\Python37\Scripts add "pip install"
然后打开 CMD 类型:C:\Users\Programs\Python\Python37\Scripts 添加“pip install”
file location where you download the PyAudio whl file add File name
下载 PyAudio whl 文件的文件位置添加文件名
example:C:\Users\Programs\Python\Python37\Scripts>pip install C:\Users\Desktop\Projects\PyAudio-0.2.11-cp37-cp37m-win_amd64.whl
例如:C:\Users\Programs\Python\Python37\Scripts>pip install C:\Users\Desktop\Projects\PyAudio-0.2.11-cp37-cp37m-win_amd64.whl