- Почему не устанавливается библиотека PyAudio?
- I can’t install pyaudio on Windows? How to solve “error: Microsoft Visual C++ 14.0 is required.”?
- 13 Answers 13
- pip is showing error while installing pyaudio
- 4 Answers 4
- How to install pyaudio? pip Install pyaudio, Giving error
- 3 Answers 3
- Cannot install pyaudio, gcc error
- 10 Answers 10
Почему не устанавливается библиотека PyAudio?
Здравствуйте!
Сразу скажу что пробовал:
1. pip install PyAudio
2. winpip install PyAudio
3. Устанавливать библиотеку в самой PyCharm
При установке в PyCharm пишет вот какую ошибку:
Collecting PyAudio
Using cached PyAudio-0.2.11.tar.gz (37 kB)
Using legacy ‘setup.py install’ for PyAudio, since package ‘wheel’ is not installed.
Installing collected packages: PyAudio
Running setup.py install for PyAudio: started
Running setup.py install for PyAudio: finished with status ‘error’
DEPRECATION: The -b/—build/—build-dir/—build-directory option is deprecated. pip 20.3 will remove support for this functionality. A possible replacement is use the TMPDIR/TEMP/TMP environment variable, possibly combined with —no-clean. You can find discussion regarding this at https://github.com/pypa/pip/issues/8333.
ERROR: Command errored out with exit status 1:
command: ‘C:\Users\Яков\PycharmProjects\Gera\venv\Scripts\python.exe’ -u -c ‘import sys, setuptools, tokenize; sys.argv[0] = ‘»‘»‘C:\\Users\\Яков\\AppData\\Local\\Temp\\pycharm-packaging\\pyaudio\\setup.py'»‘»‘; __file__='»‘»‘C:\\Users\\Яков\\AppData\\Local\\Temp\\pycharm-packaging\\pyaudio\\setup.py'»‘»‘;f=getattr(tokenize, ‘»‘»‘open'»‘»‘, open)(__file__);code=f.read().replace(‘»‘»‘\r\n'»‘»‘, ‘»‘»‘\n'»‘»‘);f.close();exec(compile(code, __file__, ‘»‘»‘exec'»‘»‘))’ install —record ‘C:\Users\Яков\AppData\Local\Temp\pip-record-7xrt9j1_\install-record.txt’ —single-version-externally-managed —compile —install-headers ‘C:\Users\Яков\PycharmProjects\Gera\venv\include\site\python3.9\PyAudio’
cwd: C:\Users\Яков\AppData\Local\Temp\pycharm-packaging\pyaudio\
Complete output (17 lines):
running install
running build
running build_py
creating build
creating build\lib.win32-3.9
copying src\pyaudio.py -> build\lib.win32-3.9
warning: build_py: byte-compiling is disabled, skipping.
running build_ext
building ‘_portaudio’ extension
creating build\temp.win32-3.9
creating build\temp.win32-3.9\Release
creating build\temp.win32-3.9\Release\src
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX86\x86\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -IC:\Users\Яков\PycharmProjects\Gera\venv\include -IC:\Users\Яков\AppData\Local\Programs\Python\Python39-32\include -IC:\Users\Яков\AppData\Local\Programs\Python\Python39-32\include -IC:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\include /Tcsrc/_portaudiomodule.c /Fobuild\temp.win32-3.9\Release\src/_portaudiomodule.obj
_portaudiomodule.c
src/_portaudiomodule.c(27): fatal error C1083: ЌҐ г¤ Ґвбп ®вЄалвм д ©« ўЄ«о票Ґ: stdio.h: No such file or directory,
error: command ‘C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\VC\\Tools\\MSVC\\14.16.27023\\bin\\HostX86\\x86\\cl.exe’ failed with exit code 2
—————————————-
ERROR: Command errored out with exit status 1: ‘C:\Users\Яков\PycharmProjects\Gera\venv\Scripts\python.exe’ -u -c ‘import sys, setuptools, tokenize; sys.argv[0] = ‘»‘»‘C:\\Users\\Яков\\AppData\\Local\\Temp\\pycharm-packaging\\pyaudio\\setup.py'»‘»‘; __file__='»‘»‘C:\\Users\\Яков\\AppData\\Local\\Temp\\pycharm-packaging\\pyaudio\\setup.py'»‘»‘;f=getattr(tokenize, ‘»‘»‘open'»‘»‘, open)(__file__);code=f.read().replace(‘»‘»‘\r\n'»‘»‘, ‘»‘»‘\n'»‘»‘);f.close();exec(compile(code, __file__, ‘»‘»‘exec'»‘»‘))’ install —record ‘C:\Users\Яков\AppData\Local\Temp\pip-record-7xrt9j1_\install-record.txt’ —single-version-externally-managed —compile —install-headers ‘C:\Users\Яков\PycharmProjects\Gera\venv\include\site\python3.9\PyAudio’ Check the logs for full command output.
Я так же пробовал много других команд для pip но ничего не получалось! Скажите как это исправить?
I can’t install pyaudio on Windows? How to solve “error: Microsoft Visual C++ 14.0 is required.”?
I have a Windows 10 PC and I want to install pyaudio to use it with my chatbot, powered by chatterbot.
I tried 2 different ways to install pyaudio.
The first way is doing this on the command prompt:
This is the result:
The second way is entering this command:
and it does nothing.
13 Answers 13
The answer by Agalin is already great and I just want to explain it in a step by step format for a novice like myself:
- find your Python version by python —version mine is 3.7.3 for example
- the easiest way to check either you have 64 or 32 Python just open it in the terminal:
- find the appropriate .whl file from here, for example mine is PyAudio‑0.2.11‑cp37‑cp37m‑win_amd64.whl , and download it.
- go to the folder where it is downloaded for example cd C:\Users\foobar\Downloads
- install the .whl file with pip for example in my case:
First run your IDE or CMD as Administrator and run the following:
There is no wheel (prebuilt package) for Python 3.7 on Windows (there is one for Python 2.7 and 3.4 up to 3.6) so you need to prepare build environment on your PC to use this package. Easier would be finding the wheel for 3.7 as some packages are quite hard to build on Windows.
Christoph Gohlke (University of California) hosts Windows wheels for most popular packages for nearly all modern Python versions, including latest PyAudio. You can find it here: https://www.lfd.uci.edu/
gohlke/pythonlibs/ (download can be quite slow). After download, just type pip install .
There is no difference between python -m pip install , and pip install as long as you’re using default installation settings and single python installation. python pip actually tries to run file pip in the current directory.
Edit. See the pipwin comment for automated way of using Mr Goblke’s libs . Note that I’ve not used it myself and I’m not sure about selecting different package flavors like vanilla and mkl versions of numpy .
pip is showing error while installing pyaudio
I am trying to install pyAudio with pip, I have also try pyaudio, I don’t know why this is happening , it is showing some error , please some one tell me solution
This is the error
4 Answers 4
You should install C++ redistributables, it is emphasized in the traceback output:
error: Microsoft Visual C++ 14.0 is required. Get it with «Microsoft Visual C++ Build Tools»: https://visualstudio.microsoft.com/downloads/
I believe this is a shortcut link to the installation package: http://www.microsoft.com/en-us/download/details.aspx?id=48145
You need to install visual studio from this link Visual Studio
OR
You can download PyAudio package from this link Window Binary for python . In this website go to the PyAudio package and then download it, Now go to the location where this file is downloaded on your laptop with window PowerShell, AND then run pip install .
It will solve your problem.
You don’t need to download or any Microsoft Visual C++ Build Tools. Just do the following, it will fix everything. I had the exact same error. After you go to this link: https://www.lfd.uci.edu/
gohlke/pythonlibs/ select and download the PyAudio for your Python version.
Place the downloaded file into the Scrips folder. My folder structure is:
Then you need to install the downloaded script by using the command:
python -m pip install «C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\Scripts\PyAudio-0.2.11-cp37-cp37m-win_amd64.whl»
How to install pyaudio? pip Install pyaudio, Giving error
ERROR: Command errored out with exit status 1: ‘c:\users\admin\appdata\local\programs\python\python38-32\python.exe’ -u -c ‘import sys, setuptools, tokenize; sys.argv[0] = ‘»‘»‘C:\Users\admin\AppData\Local\Temp\pip-install-q34_lfl5\pyaudio\setup.py'»‘»‘; file='»‘»‘C:\Users\admin\AppData\Local\Temp\pip-install-q34_lfl5\pyaudio\setup.py'»‘»‘;f=getattr(tokenize, ‘»‘»‘open'»‘»‘, open)(file);code=f.read().replace(‘»‘»‘\r\n'»‘»‘, ‘»‘»‘\n'»‘»‘);f.close();exec(compile(code, file, ‘»‘»‘exec'»‘»‘))’ install —record ‘C:\Users\admin\AppData\Local\Temp\pip-record-q8jvhxle\install-record.txt’ —single-version-externally-managed —compile —install-headers ‘c:\users\admin\appdata\local\programs\python\python38-32\Include\pyaudio’ Check the logs for full command output.
3 Answers 3
I had the same problem. you should install pyaudio offline.
First, download the whl file from here then install it.
Windows wheels are the most popular packages for nearly all modern Python versions, including the latest PyAudio.
please attention, you should download the version is capable with your system. If you got error like this: ERROR: PyAudio-0.2.11-cp39-cp39-win32.whl is not a supported wheel on this platform.
try another file until installing successfully.
Cannot install pyaudio, gcc error
Trying to install pyaudio with instructions per here:
What’s going wrong in my installation?
10 Answers 10
Sorry about the inappropriate answer last time, I will post the solution of the question. It might be helpful for Ubuntu distributions.
First we need to install portaudio modules: sudo apt-get install libasound-dev
Unzip the archive: tar -zxvf [portaudio.tgz]
Enter the directory, then run: ./configure && make
Install: sudo make install
And finally: sudo pip install pyaudio
Check the version of pyaudio, it should be 0.2.9
This worked for me:
Install 2 things,
For Windows :
Install using pip:
if pip is not already bundled with your installation of Python, get it here.
For Mac OS X :
Use Homebrew to install the prerequisite portaudio library, then install PyAudio using pip:
pip will download the PyAudio source and build it for your version of Python.
For Debian/Ubuntu :
Use the package manager to install PyAudio :
If the latest version of PyAudio is not available, install it using pip:
For better isolation from system packages, consider installing PyAudio in a virtual environment
PyAudio Source :
Source is available for download at the Python Package Index (PyPI): here!