简体   繁体   中英

Can't Install PyAudio in Python 3.8

I have an issue with PyAudio I Have installed PyAudio in Python 3.6 and Python 3.8 via Python unofficial libraries.

C:\Users\Baali>pip install --user PyAudio

Successfully installed PyAudio-0.2.11

But when I tried to import PyAudio it says:

import PyAudio

Traceback (most recent call last):
File "", line 1, in ModuleNotFoundError: No module named 'PyAudio'

For Windows OS run:

pip install pipwin
pipwin install pyaudio

For Linux OS run:

sudo apt-get install libasound-dev portaudio19-dev libportaudio2 libportaudiocpp0
pip install pyaudio --user

check this link for more info: https://www.codegrepper.com/code-examples/python/install+pyaudio+pip3+ubuntu

I don't know if this will make any difference but try installing pyaudio (all lowercase).

pip install pyaudio


Update 1:

I recreated your error and import pyaudio works but import PyAudio doesn't work.

在此处输入图像描述


Update 2:

I extracted the following directions from this post:

ModuleNotFoundError: No module named 'pyaudio' (Windows)

"General solution (for Windows)

The best thing is not to rely on your system PATH. Use the py launcher to select the version you want. To run the pip module corresponding to the Python version you want to use, start pip as a module instead of executable. So instead of:

pip install <package>

run (try 3.8 here instead of 3.6):

py -3.6 -m pip install <package>

To see which Python packages you have installed for that Python version, use:

py -3.6 -m pip freeze "

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM