简体   繁体   中英

Can't install PyAudio on PyCharm

So I've tied to download PyAudio on PyCharm. When it's downloading I get an error: "Error occurred when installing package 'PyAudio'. Details..." When I click "Details" I get:

Collecting PyAudio
 Using cached PyAudio-0.2.11.tar.gz (37 kB)
 Preparing metadata (setup.py): started
 Preparing metadata (setup.py): finished with status 'done'
Building wheels for collected packages: PyAudio
 Building wheel for PyAudio (setup.py): started
 Building wheel for PyAudio (setup.py): finished with status 'error'
 Running setup.py clean for PyAudio
Failed to build PyAudio
Installing collected packages: PyAudio
 Running setup.py install for PyAudio: started
 Running setup.py install for PyAudio: finished with status 'error'

 error: subprocess-exited-with-error
 
 python setup.py bdist_wheel did not run successfully.
 exit code: 1
 
 [14 lines of output]
 running bdist_wheel
 running build
 running build_py
 creating build
 creating build\lib.win-amd64-3.10
 copying src\pyaudio.py -> build\lib.win-amd64-3.10
 warning: build_py: byte-compiling is disabled, skipping.
 
 running build_ext
 creating build\temp.win-amd64-3.10
 creating build\temp.win-amd64-3.10\Release
 creating build\temp.win-amd64-3.10\Release\src
 cl.exe /c /nologo /O2 /W3 /GL /DNDEBUG /MD -DMS_WIN64=1 -IC:\Users\Pirnar\PycharmProjects\pythonProject\venv\include -IC:\Users\Pirnar\AppData\Local\Programs\Python\Python310\include -IC:\Users\Pirnar\AppData\Local\Programs\Python\Python310\Include /Tcsrc/_portaudiomodule.c /Fobuild\temp.win-amd64-3.10\Release\src/_portaudiomodule.obj
 error: command 'cl.exe' failed: None
 [end of output]
 
 note: This error originates from a subprocess, and is likely not a problem with pip.
 ERROR: Failed building wheel for PyAudio
 error: subprocess-exited-with-error
 
 Running setup.py install for PyAudio did not run successfully.
 exit code: 1
 
 [16 lines of output]
 running install
 C:\Users\Pirnar\PycharmProjects\pythonProject\venv\lib\site-packages\setuptools\command\install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
   warnings.warn(
 running build
 running build_py
 creating build
 creating build\lib.win-amd64-3.10
 copying src\pyaudio.py -> build\lib.win-amd64-3.10
 warning: build_py: byte-compiling is disabled, skipping.
 
 running build_ext
 creating build\temp.win-amd64-3.10
 creating build\temp.win-amd64-3.10\Release
 creating build\temp.win-amd64-3.10\Release\src
 cl.exe /c /nologo /O2 /W3 /GL /DNDEBUG /MD -DMS_WIN64=1 -IC:\Users\Pirnar\PycharmProjects\pythonProject\venv\include -IC:\Users\Pirnar\AppData\Local\Programs\Python\Python310\include -IC:\Users\Pirnar\AppData\Local\Programs\Python\Python310\Include /Tcsrc/_portaudiomodule.c /Fobuild\temp.win-amd64-3.10\Release\src/_portaudiomodule.obj
 error: command 'cl.exe' failed: None
 [end of output]
 
 note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure

Encountered error while trying to install package.

PyAudio

note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.

I have tried downloadin it by typing this in to terminal

pip install pipwin
pipwin install pyaudio

Also I have downloaded C++ Build tools.

I am using windows 10 pro, python 3.10 and pycharm community edition 2022.1 What do I do?

Check out this link . You will find a solution to your problem. You have too prepare your environment before installation.

This is a well-known problem and the solution is already in the official docs

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