簡體   English   中英

無法在 PyCharm 上安裝 PyAudio

[英]Can't install PyAudio on PyCharm

所以我在 PyCharm 上下載了 PyAudio。下載時出現錯誤:“安裝 package 'PyAudio' 時發生錯誤。詳細信息...” 當我單擊“詳細信息”時,我得到:

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.

我已經嘗試通過在終端中輸入這個來下載它

pip install pipwin
pipwin install pyaudio

我還下載了 C++ 構建工具。

我正在使用 windows 10 pro、python 3.10 和 pycharm 社區版 2022.1 我該怎么辦?

查看此鏈接 您會找到解決問題的方法。 安裝前你也准備好你的環境。

這是一個眾所周知的問題,解決方案已經在官方文檔

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM