简体   繁体   中英

how do i install pyaudio on windows ten for python 3.8.5

I downloaded py audio on windows ten but when i run the code it says please build and install the PortAudio Python bindings first. When i did pip install portAudio or pip install port audio it said:

    ERROR: Command errored out with exit status 1:
     command: 'c:\users\stewa\appdata\local\programs\python\python38-32\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\stewa\\AppData\\Local\\Temp\\pip-install-0ync7n97\\audio.coders\\setup.py'"'"'; __file__='"'"'C:\\Users\\stewa\\AppData\\Local\\Temp\\pip-install-0ync7n97\\audio.coders\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\stewa\AppData\Local\Temp\pip-pip-egg-info-cg067rmb'
         cwd: C:\Users\stewa\AppData\Local\Temp\pip-install-0ync7n97\audio.coders\
    Complete output (5 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\stewa\AppData\Local\Temp\pip-install-0ync7n97\audio.coders\setup.py", line 5, in <module>
        import ConfigParser
    ModuleNotFoundError: No module named 'ConfigParser'
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full 
command 
output.

Does anyone know what i should do? many thanks

According to the documentation, the python wheels only provide support up to version 3.6 of python. Apparently you're using the latest version, I've tested it on my system (Win10) using python 3.6 using this command:

python -m pip install pyaudio

And it works

Learn more about it here

That probably happened because you got the wrong PyAudio version. You have to get the compatible version with your windows(32 or 64) and with python. check here

First you have to uninstall PyAudio first using the command pip uninstall pyAudio

Then after you getting the right version you got to the repository and install it.

Example: pip install PyAudio‑0.2.11‑cp39‑cp39‑win_amd64.whl

These steps solved the issue for me

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

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