Can't Install Pyaudio - python

Can't install Pyaudio in my python 3.7..even tried installing visual c++.
pip install pyaudio
Collecting pyaudio
Using cached https://files.pythonhosted.org/packages/ab/42/b4f04721c5c5bfc196ce156b3c768998ef8c0ae3654ed29ea5020c749a6b/PyAudio-0.2.11.tar.gz
Building wheels for collected packages: pyaudio
Running setup.py bdist_wheel for pyaudio
Complete output from command "c:\users\vicky kumar\appdata\local\programs\python\python37\python.exe" -c "import setuptools;__file__='C:\\Users\\VICKYK~1\\AppData\\Local\\Temp\\pip-build-5v23nswh\\pyaudio\\setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" bdist_wheel -d C:\Users\VICKYK~1\AppData\Local\Temp\tmprsn0men8pip-wheel-:
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win-amd64-3.7
copying src\pyaudio.py -> build\lib.win-amd64-3.7
running build_ext
building '_portaudio' extension
error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": http://landinghub.visualstudio.com/visual-cpp-build-tools
----------------------------------------
Failed building wheel for pyaudio
Failed to build pyaudio
Installing collected packages: pyaudio
Running setup.py install for pyaudio
Complete output from command "c:\users\vicky kumar\appdata\local\programs\python\python37\python.exe" -c "import setuptools, tokenize;__file__='C:\\Users\\VICKYK~1\\AppData\\Local\\Temp\\pip-build-5v23nswh\\pyaudio\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record C:\Users\VICKYK~1\AppData\Local\Temp\pip-m53gsf79-record\install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_py
running build_ext
building '_portaudio' extension
error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": http://landinghub.visualstudio.com/visual-cpp-build-tools
----------------------------------------
Command ""c:\users\vicky kumar\appdata\local\programs\python\python37\python.exe" -c "import setuptools, tokenize;__file__='C:\\Users\\VICKYK~1\\AppData\\Local\\Temp\\pip-build-5v23nswh\\pyaudio\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record C:\Users\VICKYK~1\AppData\Local\Temp\pip-m53gsf79-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\VICKYK~1\AppData\Local\Temp\pip-build-5v23nswh\pyaudio

The reason that you cant install Pyaudio is your python version, the last version of python that support Pyaudio is python 3.6
So you have to install python 3.6 or 3.5 or 3.4 or python 2.7.
after installing python 3.6 use this link and download pyaudio.whl according to your os.
then use this command to install it:
pip install <package_name>.whl

To install the latest version of pyaudio using conda:
source activate -your environment name-
pip install pyaudio
If you encounter PortAudio development package error, install it with
sudo apt-get install portaudio19-dev

Related

Python library installation libact: Failed building wheel for libact [duplicate]

This question already has an answer here:
Python, failed to install. Exit code: 1 windows 10
(1 answer)
Closed 3 years ago.
I am trying to install python library libact but get the following error:
Failed building wheel for libact
Running setup.py clean for libact
Failed to build libact
Installing collected packages: libact
Running setup.py install for libact ... error
Complete output from command C:\Users\user\AppData\Local\Continuum\anaconda3\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\user\\AppData\\Local\\Temp\\pip-install-nmmfnje9\\libact\\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\user\AppData\Local\Temp\pip-record-13e1bgj8\install-record.txt --single-version-externally-managed --compile
No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
building 'libact.query_strategies._variance_reduction' extension
error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": https://visualstudio.microsoft.com/downloads/
I tried to install pip install wheel but still shows the same error.
as written here
Try to update your packegs:
pip install -U setuptools
pip install -U wheel

Can't install PyAudio in python [duplicate]

This question already has answers here:
I can't install pyaudio on Windows? How to solve "error: Microsoft Visual C++ 14.0 is required."?
(17 answers)
Closed 2 years ago.
I get the following ERROR while installing pyaudio
C:\Users\Admin\Downloads>pip install pyaudio
Collecting pyaudio
Using cached https://files.pythonhosted.org/packages/ab/42/b4f04721c5c5bfc196ce156b3c768998ef8c0ae3654ed29ea5020c749a6b/PyAudio-0.2.11.tar.gz
Installing collected packages: pyaudio
Running setup.py install for pyaudio ... error
ERROR: Complete output from command 'c:\users\admin\appdata\local\programs\python\python37\python.exe' -u -c 'import setuptools, tokenize;__file__='"'"'C:\\Users\\Admin\\AppData\\Local\\Temp\\pip-install-snth_fqh\\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-3n7dvpm8\install-record.txt' --single-version-externally-managed --compile:
ERROR: running install
running build
running build_py
creating build
creating build\lib.win-amd64-3.7
copying src\pyaudio.py -> build\lib.win-amd64-3.7
running build_ext
building '_portaudio' extension
error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": https://visualstudio.microsoft.com/downloads/
----------------------------------------
ERROR: Command "'c:\users\admin\appdata\local\programs\python\python37\python.exe' -u -c 'import setuptools, tokenize;__file__='"'"'C:\\Users\\Admin\\AppData\\Local\\Temp\\pip-install-snth_fqh\\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-3n7dvpm8\install-record.txt' --single-version-externally-managed --compile" failed with error code 1 in C:\Users\Admin\AppData\Local\Temp\pip-install-snth_fqh\pyaudio\
You are missing Visual C++ from your computer. Download and install from here: https://www.microsoft.com/en-us/download/details.aspx?id=48145
and then re run the install for PyAudio.
Visual Studio changed the Build Tools from being C++ specific in late 2017. Thus newer Visual Studio versions work in place of older versions.
You can install it using:
1.https://visualstudio.microsoft.com/thank-you-downloading-visual-studio/?sku=BuildTools&rel=16
2.https://visualstudio.microsoft.com/downloads/#build-tools-for-visual-studio-2019
Windows Python needs Visual C++ libraries installed via the SDK to build code.

Having problems with installing manimlib by 3blue1brown. Pycairo runs into a problem

I'm attempting to install the manimlib package by 3blue1brown for math animations, all goes well until the installation of pycairo
I have followed the instructions from https://github.com/3b1b/manim, downloading and installing all of the system requirements "ffmpeg, sox, latex and cairo"
I have also followed instructions to install the Microsoft Visual C++ Build Tools however the same error occurs.
I attempted to pip install manimlib and it displayed the errors below
Many other tutorials for installing manimlib all gave me the same error.
Building wheels for collected packages: pycairo
Building wheel for pycairo (setup.py) ... error
ERROR: Complete output from command 'c:\users\jmcaw\appdata\local\programs\python\python37-32\python.exe' -u -c 'import setuptools, tokenize;__file__='"'"'C:\\Users\\jmcaw\\AppData\\Local\\Temp\\pip-install-nh2i0b16\\pycairo\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d 'C:\Users\jmcaw\AppData\Local\Temp\pip-wheel-mzptag15' --python-tag cp37:
ERROR: running bdist_wheel
running build
running build_py
creating build
creating build\lib.win32-3.7
creating build\lib.win32-3.7\cairo
copying cairo\__init__.py -> build\lib.win32-3.7\cairo
copying cairo\__init__.pyi -> build\lib.win32-3.7\cairo
copying cairo\py.typed -> build\lib.win32-3.7\cairo
running build_ext
building 'cairo._cairo' extension
error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": https://visualstudio.microsoft.com/downloads/
----------------------------------------
ERROR: Failed building wheel for pycairo
Running setup.py clean for pycairo
Failed to build pycairo
Installing collected packages: pycairo, manimlib
Found existing installation: pycairo 1.18.1
Uninstalling pycairo-1.18.1:
Successfully uninstalled pycairo-1.18.1
Running setup.py install for pycairo ... error
ERROR: Complete output from command
'c:\users\jmcaw\appdata\local\programs\python\python37-32\python.exe' -u -c 'import setuptools, tokenize;__file__='"'"'C:\\Users\\jmcaw\\AppData\\Local\\Temp\\pip-install-nh2i0b16\\pycairo\\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\jmcaw\AppData\Local\Temp\pip-record-bsapizpe\install-record.txt' --single-version-externally-managed --compile:
ERROR: running install
running build
running build_py
creating build
creating build\lib.win32-3.7
creating build\lib.win32-3.7\cairo
copying cairo\__init__.py -> build\lib.win32-3.7\cairo
copying cairo\__init__.pyi -> build\lib.win32-3.7\cairo
copying cairo\py.typed -> build\lib.win32-3.7\cairo
running build_ext
building 'cairo._cairo' extension
error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": https://visualstudio.microsoft.com/downloads/
----------------------------------------
Rolling back uninstall of pycairo
Moving to c:\users\jmcaw\appdata\local\programs\python\python37-32\lib\site-packages\cairo\
from c:\users\jmcaw\appdata\local\programs\python\python37-32\lib\site-packages\~airo
Moving to c:\users\jmcaw\appdata\local\programs\python\python37-32\lib\site-packages\pycairo-1.18.1.dist-info\
from c:\users\jmcaw\appdata\local\programs\python\python37-32\lib\site-packages\~ycairo-1.18.1.dist-info
ERROR: Command "'c:\users\jmcaw\appdata\local\programs\python\python37-32\python.exe' -u -c 'import setuptools, tokenize;__file__='"'"'C:\\Users\\jmcaw\\AppData\\Local\\Temp\\pip-install-nh2i0b16\\pycairo\\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\jmcaw\AppData\Local\Temp\pip-record-bsapizpe\install-record.txt' --single-version-externally-managed --compile" failed with error code 1 in C:\Users\jmcaw\AppData\Local\Temp\pip-install-nh2i0b16\pycairo\
The installation on pycairo on its own works when using the file pycairo‑1.18.1‑cp37‑cp37m‑win32.whl from https://www.lfd.uci.edu/~gohlke/pythonlibs/#pycairo, however it appears to try and uninstall this and install the version 1.18.0 instead of the latest 1.18.1.

pyaudio Library Installation Error How to fix it

When installing pyaudio in the command prompt with:
python -m pip install pyaudio
I get an error:
ERROR: Complete output from command 'C:\python\python.exe' -u -c 'import setuptools, tokenize;__file__='"'"'C:\\Users\\admin\\AppData\\Local\\Temp\\pip-install-c823_6j8\\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-vkr4rksd\install-record.txt' --single-version-externally-managed --compile:
ERROR: running install
running build
running build_py
creating build
creating build\lib.win-amd64-3.7
copying src\pyaudio.py -> build\lib.win-amd64-3.7
running build_ext
building '_portaudio' extension
error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": https://visualstudio.microsoft.com/downloads/
----------------------------------------
ERROR: Command "'C:\python\python.exe' -u -c 'import setuptools, tokenize;__file__='"'"'C:\\Users\\admin\\AppData\\Local\\Temp\\pip-install-c823_6j8\\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-vkr4rksd\install-record.txt' --single-version-externally-managed --compile" failed with error code 1 in C:\Users\admin\AppData\Local\Temp\pip-install-c823_6j8\pyaudio\
You can simply grab the proper Wheel package for your current Python version from here
and then install it with pip install <PyAudio‑0.2.11-...>.whl. (remember to use full filename (e.g pip install PyAudio‑0.2.11‑cp37‑cp37m‑win_amd64.whl).
You don't need to download or any Microsoft Visual C++ Build Tools. Just do the following, it will be an ultimate fix:
After you go to this link: https://www.lfd.uci.edu/~gohlke/pythonlibs/ select and download the PyAudio for your Python version.
I downloaded:
PyAudio-0.2.11-cp37-cp37m-win_amd64.whl
Place the downloaded file into the Scrips folder. My folder structure is:
`C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\Scripts`
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"

"Microsoft Visual C++ … is required" error when trying to install pyodbc on Windows

I am trying to install pyodbc, and I am getting the below error.
C:\Python\Python37\Scripts>pip3 install pyodbc
Output
Collecting pyodbc
Using cached https://files.pythonhosted.org/packages/aa/71/cef225c4889620a1a00251d24c1746fe0cf4124290a75d1c2dc5c187b61f/pyodbc-4.0.23.tar.gz
Installing collected packages: pyodbc
Running setup.py install for pyodbc ... error
Complete output from command c:\python\python37\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\Alankar\\AppData\\Local\\Temp\\pip-install-7qf14pkz\\pyodbc\\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\Alankar\AppData\Local\Temp\pip-record-k11gmg0x\install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_ext
building 'pyodbc' extension
error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": http://landinghub.visualstudio.com/visual-cpp-build-tools
Command "c:\python\python37\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\Alankar\\AppData\\Local\\Temp\\pip-install-7qf14pkz\\pyodbc\\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\Alankar\AppData\Local\Temp\pip-record-k11gmg0x\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\Alankar\AppData\Local\Temp\pip-install-7qf14pkz\pyodbc\
I couldn't get the C++ build tools method to work, but I found this method to be very straightforward:
Download the relevant pyodbc wheel (pre-compiled binary) based on your computer's architecture and version of Python: https://www.lfd.uci.edu/~gohlke/pythonlibs/#pyodbc
Run pip install <wheel path>.
For example:
pip install c:\users\bob\downloads\pyodbc-4.0.27-cp38-cp38-win_amd64.whl
Some Libraries require C++ build tools to install. In your case, to solve this problem there are two methods which are:
Update the pip's Setup tool:
To fix your error update the setup tool by this command:
pip install --upgrade setuptools
And the second method is to:
Install the Microsoft Visual C++ Build Tools
This can also be fixed by installing this little tool provided by Microsoft:
https://visualstudio.microsoft.com/visual-cpp-build-tools/
the install failed on my machine even after I installed Microsoft VC++ build tools, my solution for this is install an early version. the newer version assume you have VC++ and VS 2019 installed.
run this command
pip install -Iv pyodbc==4.0.27
If none of the other answers work:
I was running the newest version of python and it was giving me this error.
As soon as I downgraded to 3.8.x it worked like a charm using pip install

Categories

Resources