Unable to install pip install ibm-db - python

I'm trying to install ibm-db package but i'm getting the following error.
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.25.28610\bin\HostX86\x86\link.exe /nologo /INCREMENTAL:NO /LTCG /DLL /MANIFEST:EMBED,ID=2 /MANIFESTUAC:NO /LIBPATH:clidriver\lib "/LIBPATH:C:\Users\
vishal.sivala\OneDrive - David Jones\Desktop\Testing\venv\libs" /LIBPATH:C:\Users\vishal.sivala\AppData\Local\Programs\Python\Python38-32\libs /LIBPATH:C:\Users\vishal.sivala\AppData\Local\Programs\Python\Python38-32 "/LIBPATH:C:\Us
ers\vishal.sivala\OneDrive - David Jones\Desktop\Testing\venv\PCbuild\win32" "/LIBPATH:C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.25.28610\lib\x86" "/LIBPATH:C:\Program Files (x86)\Windows Kits\N
ETFXSDK\4.8\lib\um\x86" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.18362.0\ucrt\x86" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.18362.0\um\x86" db2cli64.lib /EXPORT:PyInit_ibm_db build\temp.win32-3.8\Re
lease\ibm_db.obj /OUT:build\lib.win32-3.8\ibm_db.cp38-win32.pyd /IMPLIB:build\temp.win32-3.8\Release\ibm_db.cp38-win32.lib
LINK : fatal error LNK1181: cannot open input file 'db2cli64.lib'
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Tools\\MSVC\\14.25.28610\\bin\\HostX86\\x86\\link.exe' failed with exit status 1181
----------------------------------------
Command ""C:\Users\vishal.sivala\OneDrive - David Jones\Desktop\Testing\venv\Scripts\python.exe" -u -c "import setuptools, tokenize;__file__='C:\\Users\\vishal.sivala\\AppData\\Local\\Temp\\pip-install-2qkgnojm\\ibm-db\\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\vishal.sivala\AppData\Local\Temp\pip-record-wv9aeo8c\install-record.txt --singl
e-version-externally-managed --compile --install-headers "C:\Users\vishal.sivala\OneDrive - David Jones\Desktop\Testing\venv\include\site\python3.8\ibm-db"" failed with error code 1 in C:\Users\vishal.sivala\AppData\Local\Temp\pip-install-2qkgnojm\ibm-db\

Starting from 16th June 2020, the ibm_db version 3.0.2 includes support for Python 3.8 on the Microsoft Windows platform.
At April 2020 the python ibm_db module (versions up to v3.0.1) on Microsoft-Windows did not operate with Python 3.8. Now fixed with ibm_db version 3.0.2 since 16/June/2020.

Related

C4365: 'return': conversion from 'std::size_t' to 'Py_ssize_t', signed/unsigned mismatch error

I'm getting a strange error when attempting to install pyodbc on my local machine in command prompt. Some sort of conversion error that might relate to Visual Studio? Any help would be appreciated. I'm running Python 3.8.2.
C:\Users\****.****\OneDrive\PythonProjects\venv\Scripts>pip install pyodbc
Collecting pyodbc
Using cached https://files.pythonhosted.org/packages/81/0d/bb08bb16c97765244791c73e49de9fd4c24bb3ef00313aed82e5640dee5d/pyodbc-4.0.30.tar.gz
Installing collected packages: pyodbc
Running setup.py install for pyodbc ... error
Complete output from command C:\Users\****.****\OneDrive\PythonProjects\venv\Scripts\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\****.****\\AppData\\Local\\Temp\\pip-install-4nnxqm8v\\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\****.****\AppData\Local\Temp\pip-record-9ksqmk4o\install-record.txt --single-version-externally-managed --compile --install-headers C:\Users\****.****\OneDrive\PythonProjects\venv\include\site\python3.8\pyodbc:
running install
running build
running build_ext
building 'pyodbc' extension
creating build
creating build\temp.win32-3.8
creating build\temp.win32-3.8\Release
creating build\temp.win32-3.8\Release\src
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DPYODBC_VERSION=4.0.30 -IC:\Users\****.****\OneDrive\PythonProjects\venv\include -IC:\Users\****.****\AppData\Local\Programs\Python\Python38-32\include -IC:\Users\****.****\AppData\Local\Programs\Python\Python38-32\include "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\8.1\include\shared" "-IC:\Program Files (x86)\Windows Kits\8.1\include\um" "-IC:\Program Files (x86)\Windows Kits\8.1\include\winrt" /EHsc /Tpsrc\buffer.cpp /Fobuild\temp.win32-3.8\Release\src\buffer.obj /Wall /wd4514 /wd4820 /wd4668 /wd4711 /wd4100 /wd4127 /wd4191 /d2FH4-
buffer.cpp
c:\users\****.****\appdata\local\programs\python\python38-32\include\cpython/abstract.h(77): warning C4365: 'return': conversion from 'std::size_t' to 'Py_ssize_t', signed/unsigned mismatch
fatal error C1007: unrecognized flag '-FH4-' in 'p2'
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\cl.exe' failed with exit status 1
----------------------------------------
Command "C:\Users\****.****\OneDrive\PythonProjects\venv\Scripts\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\****.****\\AppData\\Local\\Temp\\pip-install-4nnxqm8v\\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\****.****\AppData\Local\Temp\pip-record-9ksqmk4o\install-record.txt --single-version-externally-managed --compile --install-headers C:\Users\****.****\OneDrive\PythonProjects\venv\include\site\python3.8\pyodbc" failed with error code 1 in C:\Users\****.****\AppData\Local\Temp\pip-install-4nnxqm8v\pyodbc\
The message you cite in your question title is just a warning.
warning C4365: 'return': conversion from 'std::size_t' to 'Py_ssize_t', signed/unsigned mismatch
Such warnings are not unusual when building pyodbc from source on Windows.
The actual error is
fatal error C1007: unrecognized flag '-FH4-' in 'p2'
error: command 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\cl.exe' failed with exit status 1
and that's because your version of Visual Studio is too old to build pyodbc for Python 3.8. According to …
Building pyodbc from source
… Visual Studio 2019 (version 16) is required, but you appear to have Visual Studio 2015 (version 14).
The strange thing is that pip is trying to build from source when pyodbc 4.0.30 already has a Windows wheel for 32-bit Python 3.8
pyodbc-4.0.30-cp38-cp38-win32.whl
You could try downloading that and then running
pip install pyodbc-4.0.30-cp38-cp38-win32.whl

How to get Poppler running on Windows

I want to install the pdftotext library for python3. For this, I need Poppler. Now, there is a question regarding this (How to install Poppler on Windows?) but the answers do not work for me. Specifically, when I write
conda install -c conda-forge poppler
it tells me that it is looking for conflicts. After quite a long time, it finished successfully but when I then try to run pip3 install pdftotext it tells me
`...
C4514: '_cwscanf_s_l': unreferenced inline function has been removed
C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt\corecrt_wconio.h(411): warning C4514: '_cwscanf_s': unreferenced inline function has been removed
C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt\wchar.h(180): warning C4514: 'fwide': unreferenced inline function has been removed
C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt\wchar.h(189): warning C4514: 'mbsinit': unreferenced inline function has been removed
C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt\wchar.h(209): warning C4514: 'wmemcmp': unreferenced inline function has been removed
C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt\wchar.h(268): warning C4514: 'wmemchr': unreferenced inline function has been removed
creating C:\Users\l\AppData\Local\Temp\pip-install-hyxyhu1h\pdftotext\build\lib.win-amd64-3.7
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.27.29110\bin\HostX86\x64\link.exe /nologo /INCREMENTAL:NO /LTCG /DLL /MANIFEST:EMBED,ID=2 /MANIFESTUAC:NO /LIBPATH:c:\users\l\appdata\local\programs\python\python37\libs /LIBPATH:c:\users\l\appdata\local\programs\python\python37\PCbuild\amd64 "/LIBPATH:C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.27.29110\lib\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.18362.0\ucrt\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.18362.0\um\x64" poppler-cpp.lib /EXPORT:PyInit_pdftotext build\temp.win-amd64-3.7\Release\pdftotext.obj /OUT:build\lib.win-amd64-3.7\pdftotext.cp37-win_amd64.pyd /IMPLIB:build\temp.win-amd64-3.7\Release\pdftotext.cp37-win_amd64.lib
LINK : fatal error LNK1181: cannot open input file 'poppler-cpp.lib'
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Tools\\MSVC\\14.27.29110\\bin\\HostX86\\x64\\link.exe' failed with exit status 1181
ERROR: Command errored out with exit status 1: 'c:\users\l\appdata\local\programs\python\python37\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\l\\AppData\\Local\\Temp\\pip-install-hyxyhu1h\\pdftotext\\setup.py'"'"'; __file__='"'"'C:\\Users\\l\\AppData\\Local\\Temp\\pip-install-hyxyhu1h\\pdftotext\\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\l\AppData\Local\Temp\pip-record-rhe9mc37\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\l\appdata\local\programs\python\python37\Include\pdftotext' Check the logs for full command output.`
I have also tried the apprachwith copying to program files but that gave me the same result. Any suggestions on what I might do to fix this?

Python: "pip install gmpy" on Windows 10 returns "cl.exe' failed with exit status 2"

I've installed Pyhton 3.7 on Windows10 and when I run pip install gmpy the console return me this error:
Collecting gmpy
Using cached https://files.pythonhosted.org/packages/26/37/2184c13cee81e1dbeaebbb13570195247e73ab2138a3db0c9d2c5347e372/gmpy-1.17.zip
Building wheels for collected packages: gmpy
Building wheel for gmpy (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: 'c:\python37\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\franc\\AppData\\Local\\Temp\\pip-install-du1j9u7s\\gmpy\\setup.py'"'"'; __file__='"'"'C:\\Users\\franc\\AppData\\Local\\Temp\\pip-install-du1j9u7s\\gmpy\\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\franc\AppData\Local\Temp\pip-wheel-nz4_kuat' --python-tag cp37
cwd: C:\Users\franc\AppData\Local\Temp\pip-install-du1j9u7s\gmpy\
Complete output (12 lines):
running bdist_wheel
running build
running build_ext
building 'gmpy' extension
creating build
creating build\temp.win-amd64-3.7
creating build\temp.win-amd64-3.7\Release
creating build\temp.win-amd64-3.7\Release\src
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.23.28105\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MT -Ic:\python37\include -Ic:\python37\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.23.28105\include" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.7.2\include\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\cppwinrt" /Tcsrc/gmpy.c /Fobuild\temp.win-amd64-3.7\Release\src/gmpy.obj
gmpy.c
C:\Users\franc\AppData\Local\Temp\pip-install-du1j9u7s\gmpy\src\gmpy.h(30): fatal error C1083: Cannot open include file: 'gmp.h': No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Tools\\MSVC\\14.23.28105\\bin\\HostX86\\x64\\cl.exe' failed with exit status 2
----------------------------------------
ERROR: Failed building wheel for gmpy
Running setup.py clean for gmpy
Failed to build gmpy
Installing collected packages: gmpy
Running setup.py install for gmpy ... error
ERROR: Command errored out with exit status 1:
command: 'c:\python37\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\franc\\AppData\\Local\\Temp\\pip-install-du1j9u7s\\gmpy\\setup.py'"'"'; __file__='"'"'C:\\Users\\franc\\AppData\\Local\\Temp\\pip-install-du1j9u7s\\gmpy\\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\franc\AppData\Local\Temp\pip-record-q7ltkyyx\install-record.txt' --single-version-externally-managed --compile
cwd: C:\Users\franc\AppData\Local\Temp\pip-install-du1j9u7s\gmpy\
Complete output (12 lines):
running install
running build
running build_ext
building 'gmpy' extension
creating build
creating build\temp.win-amd64-3.7
creating build\temp.win-amd64-3.7\Release
creating build\temp.win-amd64-3.7\Release\src
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.23.28105\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MT -Ic:\python37\include -Ic:\python37\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.23.28105\include" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.7.2\include\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\cppwinrt" /Tcsrc/gmpy.c /Fobuild\temp.win-amd64-3.7\Release\src/gmpy.obj
gmpy.c
C:\Users\franc\AppData\Local\Temp\pip-install-du1j9u7s\gmpy\src\gmpy.h(30): fatal error C1083: Cannot open include file: 'gmp.h': No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Tools\\MSVC\\14.23.28105\\bin\\HostX86\\x64\\cl.exe' failed with exit status 2
----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\python37\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\franc\\AppData\\Local\\Temp\\pip-install-du1j9u7s\\gmpy\\setup.py'"'"'; __file__='"'"'C:\\Users\\franc\\AppData\\Local\\Temp\\pip-install-du1j9u7s\\gmpy\\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\franc\AppData\Local\Temp\pip-record-q7ltkyyx\install-record.txt' --single-version-externally-managed --compile Check the logs for full command output.
The error is in this line:
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Tools\\MSVC\\14.23.28105\\bin\\HostX86\\x64\\cl.exe' failed with exit status 2
Basically it means that Python needs cl.exe and it expect it at:
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.23.28105\bin\Hostx86\x64
No problem, I go to the Environment Variable and i add that path both for my user and for the system:
Then I check if cl.exe is successfully in the path by typing cl in the terminal and it works:
But when I run again pip install gmpy I have the same error.
EDIT: I also tried with pip install gmpy2 and I receive the same error.
Where am I wrong?
Well the actual problem is that you are missing some header file gmp.h:
C:\Users\franc\AppData\Local\Temp\pip-install-du1j9u7s\gmpy\src\gmpy.h(30): fatal error C1083: Cannot open include file: 'gmp.h': No such file or directory
I suggest you try gmpy2, which is a newer version. It has wheels for Windows on PyPI but they are for older versions of Python unfortunately. Pre-built wheels for more recent Python versions are available here. The files are named after the Python version (e.g. cp37 for CPython 3.7) and architecture (e.g. amd64 for 64-bit)
A wheel can be installed like so:
pip install gmpy2‑2.0.8‑cp37‑cp37m‑win_amd64.whl

Unable to install pyAudio package

I am building a speech recognition program but can't install pyAudio.
I have installed Microsoft visual c++ 14.0.0 but still, I am getting another error. I can't understand what is going wrong here please help me out.
ERROR: Command errored out with exit status 1:
command: 'c:\users\udit\appdata\local\programs\python\python37-32\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv\[0\] = '"'"'C:\\Users\\udit\\AppData\\Local\\Temp\\pip-install-68co_fpl\\pyaudio\\setup.py'"'"'; __file__='"'"'C:\\Users\\udit\\AppData\\Local\\Temp\\pip-install-68co_fpl\\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\udit\AppData\Local\Temp\pip-record-ih2tcx4k\install-record.txt' --single-version-externally-managed --compile
cwd: C:\Users\udit\AppData\Local\Temp\pip-install-68co_fpl\pyaudio\
Complete output (16 lines):
running install
running build
running build_py
creating build
creating build\lib.win32-3.7
copying src\pyaudio.py -> build\lib.win32-3.7
running build_ext
building '_portaudio' extension
b'\\\x00C\x00o\x00m\x00m\x00o\x00n\x00 \x00w\x00a\x00s\x00 \x00u\x00n\x00e\x00x\x00p\x00e\x00c\x00t\x00e\x00d\x00 \x00a\x00t\x00 \x00t\x00h\x00i\x00s\x00 \x00t\x00i\x00m\x00e\x00.\x00\r\x00\n\x00'
creating build\temp.win32-3.7
creating build\temp.win32-3.7\Release
creating build\temp.win32-3.7\Release\src
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\Bin\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Ic:\users\udit\appdata\local\programs\python\python37-32\include -Ic:\users\udit\appdata\local\programs\python\python37-32\include "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\Include" "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\Include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um" /Tcsrc/_portaudiomodule.c /Fobuild\temp.win32-3.7\Release\src/_portaudiomodule.obj
_portaudiomodule.c
src/_portaudiomodule.c(29): fatal error C1083: Cannot open include file: 'portaudio.h': No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\Bin\\cl.exe' failed with exit status 2
----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\users\udit\appdata\local\programs\python\python37-32\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv\[0\] = '"'"'C:\\Users\\udit\\AppData\\Local\\Temp\\pip-install-68co_fpl\\pyaudio\\setup.py'"'"'; __file__='"'"'C:\\Users\\udit\\AppData\\Local\\Temp\\pip-install-68co_fpl\\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\udit\AppData\Local\Temp\pip-record-ih2tcx4k\install-record.txt' --single-version-externally-managed --compile Check the logs for full command output.
These are notes for installation on Microsoft Windows:
pip will fetch and install PyAudio wheels (prepackaged binaries). Currently, there are wheels compatible with the official distributions of Python 2.7, 3.4, 3.5, and 3.6. For those versions, both 32-bit and 64-bit wheels are available.
You are using Python 3.7, which is not compatible with PyAudio. However...
EDIT:
As user #Dalen states, there are prebuilt binaries (.exe files) for pyAudio. I installed from their archive stated in documentation but importing pyAudio had an output:
There are unofficial binaries for Windows on this site: https://www.lfd.uci.edu/~gohlke/pythonlibs/#pyaudio .
Download the proper one and install it.
Download the binary installer for Windows and just install the PyAudio package with no nonsense.
PyAudio is built on top of portaudio library and you require portaudio to be there. The binary installer comes with precompiled version of portaudio as a dynamically linked library and there is no need for hunting and compiling the source.
PyAudio is a great library, enjoy working with it.
pip install pipwin
pipwin install pyaudio
Try these commands in prompt. It does not require any manual downloads or searches etc.
pipwin is a complementary tool for pip on Windows. It is capable of installing unofficial python package binaries for Windows provided by Christoph Gohlke
the key info in the error message is "Cannot open include file: 'portaudio.h': No such file or directory"
so you should google it, and you will find it have an answer in stackoverflow:
https://stackoverflow.com/a/52191687/5232323
the current version PyAudio 0.2.11 is not supported for Python 3.7

python count find pyaudio

This is the exception generated when I try to install pyaudio using python's pip:
ERROR: Complete output from command 'd:\python\python.exe' -u -c 'import setuptools, tokenize;__file__='"'"'C:\\Users\\ds528\\AppData\\Local\\Temp\\pip-install-3g3d86u3\\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\ds528\AppData\Local\Temp\pip-record-u7rijpbk\install-record.txt' --single-version-externally-managed --compile:
ERROR: running install
running build
running build_py
creating build
creating build\lib.win32-3.7
copying src\pyaudio.py -> build\lib.win32-3.7
running build_ext
building '_portaudio' extension
creating build\temp.win32-3.7
creating build\temp.win32-3.7\Release
creating build\temp.win32-3.7\Release\src
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.20.27508\bin\HostX86\x86\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Id:\python\include -Id:\python\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.20.27508\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\cppwinrt" /Tcsrc/_portaudiomodule.c /Fobuild\temp.win32-3.7\Release\src/_portaudiomodule.obj
_portaudiomodule.c
src/_portaudiomodule.c(29): fatal error C1083: Cannot open include file: 'portaudio.h': No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Tools\\MSVC\\14.20.27508\\bin\\HostX86\\x86\\cl.exe' failed with exit status 2
----------------------------------------
ERROR: Command "'d:\python\python.exe' -u -c 'import setuptools, tokenize;__file__='"'"'C:\\Users\\ds528\\AppData\\Local\\Temp\\pip-install-3g3d86u3\\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\ds528\AppData\Local\Temp\pip-record-u7rijpbk\install-record.txt' --single-version-externally-managed --compile" failed with error code 1 in C:\Users\ds528\AppData\Local\Temp\pip-install-3g3d86u3\pyaudio\
You are trying to compile pyaudio from source and on a Windows platform that often is more difficult than one would like.
The specific problem you have is that the compiler is trying to find the include file portaudio.h which you don't have because it isn't a standard Windows include file and it is apparently also not in the download package.
It's clear that the reason pip is attempting the compile, rather than doing a binary install, is that the most recent binary installs are for Python 3.6, and you have Python 3.7.
I suggest that you install Python 3.6 alongside your existing Python 3.7 so that you can get going with this module. There may be Python 3.7 bindings available in due course, and then again there may not. The PyPI page for this project hasn't been updated in over 2 years.

Categories

Resources