install the PortAudio Python bindings first and pyaudio - python

when i run my code in windows 10, I encounter this error
Please build and install the PortAudio Python bindings first.
i install pyaudio but in install pyaudio I faced with this error
ERROR: Complete output from command 'c:\users\epic_r_r\appdata\local\programs\python\python37\python.exe' -u -c 'import setuptools, tokenize;__file__='"'"'C:\\Users\\Epic_R_R\\AppData\\Local\\Temp\\pip-install-n7_2px9c\\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\Epic_R_R\AppData\Local\Temp\pip-record-klf4pk78\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\epic_r_r\appdata\local\programs\python\python37\python.exe' -u -c 'import setuptools, tokenize;__file__='"'"'C:\\Users\\Epic_R_R\\AppData\\Local\\Temp\\pip-install-n7_2px9c\\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\Epic_R_R\AppData\Local\Temp\pip-record-klf4pk78\install-record.txt' --single-version-externally-managed --compile" failed with error code 1 in C:\Users\Epic_R_R\AppData\Local\Temp\pip-install-n7_2px9c\PyAudio\
I installed it from another way, but I do not think it's installed properly
please help me i really need this

it seems like your package is not installed properly so, first of all, undo all the setup you do
try to uninstall and reinstall using pip
python -m pip install pyaudio
or you can try using wheel (click here to get wheel file)
pip install PyAudio-0.2.11-cp37-cp37m-win32.whl
if it is not working then try to install using anaconda
conda install -c anaconda pyaudio

I was with the same problem, I discovery that PyAudio does not support versions larger than 3.6. You can see the supported versions at this link: PyAudio
To solve this problem, I start using python 3.6.8.
Available to Download from the official Python website.
I hope this helps.

Related

pip install error: Microsoft Visual C++ 14.0 or greater is required [duplicate]

This question already has answers here:
Error "Microsoft Visual C++ 14.0 is required (Unable to find vcvarsall.bat)"
(36 answers)
Pip error: Microsoft Visual C++ 14.0 is required
(13 answers)
Closed 1 year ago.
I want to install Twint with:
pip install twint
But it failed and generating this error:
ERROR: Command errored out with exit status 1:
command: 'c:\users\ramda\appdata\local\programs\python\python39\python.exe' -u
-c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\ramda\\AppData\\Local\\Temp\\pip-install-lbx86gde\\pycares\\setup.py'"'"';
__file__='"'"'C:\\Users\\ramda\\AppData\\Local\\Temp\\pip-install-lbx86gde\\pycares\\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\ramda\AppData\Local\Temp\pip-record-itnmxqui\install-record.txt'
--single-version-externally-managed --compile --install-headers 'c:\users\ramda\appdata\local\programs\python\python39\Include\pycares'
cwd: C:\Users\ramda\AppData\Local\Temp\pip-install-lbx86gde\pycares\
Complete output (17 lines):
running install
running build
running build_py
creating build
creating build\lib.win-amd64-3.9
creating build\lib.win-amd64-3.9\pycares
copying src\pycares\errno.py -> build\lib.win-amd64-3.9\pycares
copying src\pycares\utils.py -> build\lib.win-amd64-3.9\pycares
copying src\pycares\_version.py -> build\lib.win-amd64-3.9\pycares
copying src\pycares\__init__.py -> build\lib.win-amd64-3.9\pycares
copying src\pycares\__main__.py -> build\lib.win-amd64-3.9\pycares
running build_ext
generating cffi module 'build\\temp.win-amd64-3.9\\Release\\_cares.c'
creating build\temp.win-amd64-3.9
creating build\temp.win-amd64-3.9\Release
building '_cares' extension
error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
---------------------------------------- ERROR: Command errored out with exit status 1: 'c:\users\ramda\appdata\local\programs\python\python39\python.exe' -u
-c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\ramda\\AppData\\Local\\Temp\\pip-install-lbx86gde\\pycares\\setup.py'"'"';
__file__='"'"'C:\\Users\\ramda\\AppData\\Local\\Temp\\pip-install-lbx86gde\\pycares\\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\ramda\AppData\Local\Temp\pip-record-itnmxqui\install-record.txt'
--single-version-externally-managed --compile --install-headers 'c:\users\ramda\appdata\local\programs\python\python39\Include\pycares' Check the logs for full command output.
It said:
error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools
But I already have Microsoft Visual C++ 14.* in my machine. In fact that when I tried to install it again, it says "it has already installed on your machine" or something similar like that.
I've tried a lot of ways that are written in this SO discussion. But no one works for me.
Download and install Microsoft Visual Studio build tools from https://visualstudio.microsoft.com/en/thank-you-downloading-visual-studio/?sku=BuildTools&rel=16
Reboot your computer
Upgrade pip with command python -m pip install --upgrade pip
Run your command python -m pip install twint to install the package
Upgrade your pip with: python -m pip install --upgrade pip
Upgrade your wheel with: pip install --upgrade wheel
Upgrade your setuptools with: pip install --upgrade setuptools
Close the terminal and try installing the package again.

I am not able to install Pyaudio in my windows 10

When I Write pip install pyaudio or -m pip install PyAudio
Then it shows an error like bellow -
ERROR: Command errored out with exit status 1:
command: 'C:\python37\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\SUDHAN~1\\AppData\\Local\\Temp\\pip-install-zern0h1s\\PyAudio\\setup.py'"'"'; __file__='"'"'C
:\\Users\\SUDHAN~1\\AppData\\Local\\Temp\\pip-install-zern0h1s\\PyAudio\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();ex
ec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\SUDHAN~1\AppData\Local\Temp\pip-record-b0h1w_j0\install-record.txt' --single-version-externally-managed --compile --install-headers
'C:\python37\Include\PyAudio'
cwd: C:\Users\SUDHAN~1\AppData\Local\Temp\pip-install-zern0h1s\PyAudio\
Complete output (9 lines):
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": http://landinghub.visualstudio.com/visual-cpp-build-tools
----------------------------------------
ERROR: Command errored out with exit status 1: 'C:\python37\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\SUDHAN~1\\AppData\\Local\\Temp\\pip-install-zern0h1s\\PyAudi
o\\setup.py'"'"'; __file__='"'"'C:\\Users\\SUDHAN~1\\AppData\\Local\\Temp\\pip-install-zern0h1s\\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\SUDHAN~1\AppData\Local\Temp\pip-record-b0h1w_j0\install-record.txt' --single-version-externally-ma
naged --compile --install-headers 'C:\python37\Include\PyAudio' Check the logs for full command output.
Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools
You need install MS VS here
As the error says, install Microsoft Visual C++ 14.0 - it provides required build tools. You can download it from here. Also, to avoid majority of such problems in future, make sure you have Microsoft Visual C++ Redistributable for Visual Studio 2015, 2017 and 2019 - install all of them.
Step 1: Download the Pyaudio from this website
https://www.lfd.uci.edu/~gohlke/pythonlibs/#pyaudio
Depending on your python version
Step 2: then open cmd on the same directory where pyaudio is downloaded
Step 3: Then type this command: pip install pyaudiofilename
for example
pip install PyAudio-0.2.11-cp37-cp37m-win_amd64.whl
i hope it will work!
i also tried all of these answers but none of these works!
so i tried this solution and it worked!
Here is the ScreenShot!
Before
After
Download Visual Studio installer.
After the installer is installed, launch it and go to the Workloads tab and select C++ build tools and install them.
After installing C++ build tools, try installing PyAudio in a new Command Prompt window.
Remember: install PyAudio in a new command prompt window after closing the previous window.

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.

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