Not able to install py audio: pip install pyaudio [duplicate] - python

This question already has answers here:
How to fix installation issues for PyAudio, PortAudio: "fatal error C1083: Cannot open include file: 'portaudio.h': No such file or directory"
(10 answers)
Closed 2 years ago.
Not able to install py audio: pip install pyaudio
using pycharm
now the error has changed to this, The module is listed (PyAudio-0.2.11.tar.gz) but then it returns an error (ERROR: Command errored out with exit status 1:):
(venv) C:\Users\admin\PycharmProjects\pythonProject2>pip install pyaudio
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 ... error
ERROR: Command errored out with exit status 1:
command: 'c:\users\admin\pycharmprojects\pythonproject2\venv\scripts\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\admin\
\AppData\\Local\\Temp\\pip-install-oygnlr22\\pyaudio\\setup.py'"'"'; __file__='"'"'C:\\Users\\admin\\AppData\\Local\\Temp\\pip-install-oygnlr22\\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-mnp5i0dx\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\
users\admin\pycharmprojects\pythonproject2\venv\include\site\python3.9\pyaudio'
cwd: C:\Users\admin\AppData\Local\Temp\pip-install-oygnlr22\pyaudio\
Complete output (17 lines):
running install
running build
running build_py
creating build
creating build\lib.win-amd64-3.9
copying src\pyaudio.py -> build\lib.win-amd64-3.9
running build_ext
building '_portaudio' extension
creating build\temp.win-amd64-3.9
creating build\temp.win-amd64-3.9\Release
creating build\temp.win-amd64-3.9\Release\src
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.28.29333\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DMS_WIN64=
1 -Ic:\users\admin\pycharmprojects\pythonproject2\venv\include -IC:\Users\admin\AppData\Local\Programs\Python\Python39\include -IC:\Users\admin\AppData\Local\Progr
ams\Python\Python39\include -IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.28.29333\include -IC:\Program Files (x86)\Windows Kit
s\NETFXSDK\4.8\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)\Window
s Kits\10\include\10.0.18362.0\cppwinrt /Tcsrc/_portaudiomodule.c /Fobuild\temp.win-amd64-3.9\Release\src/_portaudiomodule.obj
_portaudiomodule.c
C:\Users\admin\AppData\Local\Programs\Python\Python39\include\pyconfig.h(117): warning C4005: 'MS_WIN64': macro redefinition
src/_portaudiomodule.c: note: see previous definition of 'MS_WIN64'
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.28.29333\\bin\\HostX86\\x64\\cl.exe' failed with exit c
ode 2
----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\users\admin\pycharmprojects\pythonproject2\venv\scripts\python.exe' -u -c 'import sys, setuptools, tokenize; sys
.argv[0] = '"'"'C:\\Users\\admin\\AppData\\Local\\Temp\\pip-install-oygnlr22\\pyaudio\\setup.py'"'"'; __file__='"'"'C:\\Users\\admin\\AppData\\Local\\Temp\\pip-ins
tall-oygnlr22\\pyaudio\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compil
e(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\admin\AppData\Local\Temp\pip-record-mnp5i0dx\install-record.txt' --single-version-externally-managed
--compile --install-headers 'c:\users\admin\pycharmprojects\pythonproject2\venv\include\site\python3.9\pyaudio' Check the logs for full command output.

First run your CMD as Administrator and run the following
pip install pipwin
pipwin install pyaudio

Related

Pip install fails

I'm trying to install a package for python with the following error being given.
Collecting andor
Using cached andor-1.14.tar.gz (237 kB)
Building wheels for collected packages: andor
Building wheel for andor (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: 'C:\Users\BioPhotonics\anaconda3\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\BioPhotonics\\AppData\\Local\\Temp\\pip-install-xhxcidrk\\andor_d3d6c6374a5f483cb478ca158e6bf226\\setup.py'"'"'; __file__='"'"'C:\\Users\\BioPhotonics\\AppData\\Local\\Temp\\pip-install-xhxcidrk\\andor_d3d6c6374a5f483cb478ca158e6bf226\\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\BioPhotonics\AppData\Local\Temp\pip-wheel-3_wi37w3'
cwd: C:\Users\BioPhotonics\AppData\Local\Temp\pip-install-xhxcidrk\andor_d3d6c6374a5f483cb478ca158e6bf226\
Complete output (13 lines):
running bdist_wheel
running build
running build_ext
skipping 'andor2.c' Cython extension (up-to-date)
building 'andor2' extension
creating build
creating build\temp.win-amd64-3.8
creating build\temp.win-amd64-3.8\Release
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30037\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -I. -I.. -IC:\Users\BioPhotonics\anaconda3\lib\site-packages\numpy\core\include -I/usr/lib64/python/site-packages/Cython/Includes -IC:\Users\BioPhotonics\anaconda3\include -IC:\Users\BioPhotonics\anaconda3\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30037\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\cppwinrt" /Tcandor2.c /Fobuild\temp.win-amd64-3.8\Release\andor2.obj
andor2.c
C:\Users\BioPhotonics\anaconda3\lib\site-packages\numpy\core\include\numpy\npy_1_7_deprecated_api.h(14) : Warning Msg: Using deprecated NumPy API, disable it with #define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION
andor2.c(244): fatal error C1083: Cannot open include file: 'atmcdLXd.h': No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Tools\\MSVC\\14.29.30037\\bin\\HostX86\\x64\\cl.exe' failed with exit status 2
----------------------------------------
ERROR: Failed building wheel for andor
Running setup.py clean for andor
Failed to build andor
Installing collected packages: andor
Running setup.py install for andor ... error
ERROR: Command errored out with exit status 1:
command: 'C:\Users\BioPhotonics\anaconda3\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\BioPhotonics\\AppData\\Local\\Temp\\pip-install-xhxcidrk\\andor_d3d6c6374a5f483cb478ca158e6bf226\\setup.py'"'"'; __file__='"'"'C:\\Users\\BioPhotonics\\AppData\\Local\\Temp\\pip-install-xhxcidrk\\andor_d3d6c6374a5f483cb478ca158e6bf226\\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\BioPhotonics\AppData\Local\Temp\pip-record-fkljfz5y\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\BioPhotonics\anaconda3\Include\andor'
cwd: C:\Users\BioPhotonics\AppData\Local\Temp\pip-install-xhxcidrk\andor_d3d6c6374a5f483cb478ca158e6bf226\
Complete output (13 lines):
running install
running build
running build_ext
skipping 'andor2.c' Cython extension (up-to-date)
building 'andor2' extension
creating build
creating build\temp.win-amd64-3.8
creating build\temp.win-amd64-3.8\Release
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30037\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -I. -I.. -IC:\Users\BioPhotonics\anaconda3\lib\site-packages\numpy\core\include -I/usr/lib64/python/site-packages/Cython/Includes -IC:\Users\BioPhotonics\anaconda3\include -IC:\Users\BioPhotonics\anaconda3\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30037\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\cppwinrt" /Tcandor2.c /Fobuild\temp.win-amd64-3.8\Release\andor2.obj
andor2.c
C:\Users\BioPhotonics\anaconda3\lib\site-packages\numpy\core\include\numpy\npy_1_7_deprecated_api.h(14) : Warning Msg: Using deprecated NumPy API, disable it with #define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION
andor2.c(244): fatal error C1083: Cannot open include file: 'atmcdLXd.h': No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Tools\\MSVC\\14.29.30037\\bin\\HostX86\\x64\\cl.exe' failed with exit status 2
----------------------------------------
ERROR: Command errored out with exit status 1: 'C:\Users\BioPhotonics\anaconda3\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\BioPhotonics\\AppData\\Local\\Temp\\pip-install-xhxcidrk\\andor_d3d6c6374a5f483cb478ca158e6bf226\\setup.py'"'"'; __file__='"'"'C:\\Users\\BioPhotonics\\AppData\\Local\\Temp\\pip-install-xhxcidrk\\andor_d3d6c6374a5f483cb478ca158e6bf226\\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\BioPhotonics\AppData\Local\Temp\pip-record-fkljfz5y\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\BioPhotonics\anaconda3\Include\andor' Check the logs for full command output.
(base) C:\Users\BioPhotonics>
It seems to be an issue of the andor package. I've been reading through its files and the setup.py file does not specify a NumPy version. As the latest release of the package is from 2016, I suppose that NumPy's current version is no longer compatible with andor. I suggest you to install an older version of NumPy (perhaps the 1.7) and then try to install andor again.
EDIT: I found the following information in its setup.py file:
The package is for Python 2.7
Its author is Guillaume Lepert (guillaume.lepert07#imperial.ac.uk). Maybe you can contact him so he can give you more information about this package.

Unable to install PyAudio on Python 3.9

I'm trying to install PyAudio on Python 3.9 and it is not working. I am getting the following error:
ERROR: Command errored out with exit status 1:
command: 'c:\users\koffie\appdata\local\programs\python\python39\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\koffie\\AppData\\Local\\Temp\\pip-install-8fxj755j\\pyaudio_3c7b865f50cd493eaf257dea132d1fe1\\setup.py'"'"'; __file__='"'"'C:\\Users\\koffie\\AppData\\Local\\Temp\\pip-install-8fxj755j\\pyaudio_3c7b865f50cd493eaf257dea132d1fe1\\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\koffie\AppData\Local\Temp\pip-record-9go3oms0\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\koffie\appdata\local\programs\python\python39\Include\pyaudio'
cwd: C:\Users\koffie\AppData\Local\Temp\pip-install-8fxj755j\pyaudio_3c7b865f50cd493eaf257dea132d1fe1\
Complete output (17 lines):
running install
running build
running build_py
creating build
creating build\lib.win-amd64-3.9
copying src\pyaudio.py -> build\lib.win-amd64-3.9
running build_ext
building '_portaudio' extension
creating build\temp.win-amd64-3.9
creating build\temp.win-amd64-3.9\Release
creating build\temp.win-amd64-3.9\Release\src
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.28.29910\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DMS_WIN64=1 -Ic:\users\koffie\appdata\local\programs\python\python39\include -Ic:\users\koffie\appdata\local\programs\python\python39\include -IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.28.29910\include -IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um -IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt -IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\shared -IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um -IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt -IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041. _portaudiomodule.c
c:\users\koffie\appdata\local\programs\python\python39\include\pyconfig.h(117): warning C4005: 'MS_WIN64': macro redefinition
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Tools\\MSVC\\14.28.29910\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2
----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\users\koffie\appdata\local\programs\python\python39\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\koffie\\AppData\\Local\\Temp\\pip-install-8fxj755j\\pyaudio_3c7b865f50cd493eaf257dea132d1fe1\\setup.py'"'"'; __file__='"'"'C:\\Users\\koffie\\AppData\\Local\\Temp\\pip-install-8fxj755j\\pyaudio_3c7b865f50cd493eaf257dea132d1fe1\\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\koffie\AppData\Local\Temp\pip-record-9go3oms0\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\koffie\appdata\local\programs\python\python39\Include\pyaudio' Check the logs for full command output.
I have tried downloading Visual Basic Tools, as well as, I have tried doing the pip install pipwin and then PyAudio function. But unfortunately the same error occurred. I also tried downloading the following and installing it: PyAudio‑0.2.11‑cp39‑cp39‑win_amd64.whl
I am trying to build an Alexa-like AI, and need this PyAudio package.
Perhaps try pip install pipwin and then pipwin install pyaudio? pipwin is designed to work on Windows, so you may have better luck with it.
As of today 10-03-2022 , you have following options:
use python 3.6 (wheels available), probably you don't want to give up on the latest python version because of this dependency, but this is an easy option.
you build it from source, probably will take you some effort.
you download the wheel package from gohlke's page and tell pip to use that wheel instead of downloading it from pypi.

When I try to download PyAudio I just got this error message. This is so painful. Pls pleh [duplicate]

This question already has answers here:
PyAudio failed to install on Windows 10
(7 answers)
How to fix installation issues for PyAudio, PortAudio: "fatal error C1083: Cannot open include file: 'portaudio.h': No such file or directory"
(10 answers)
Closed 1 year ago.
C:\Users\lansz>pip install pyaudio
Using cached PyAudio-0.2.11.tar.gz (37 kB)
Building wheels for collected packages: pyaudio
Building wheel for pyaudio (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: 'c:\users\lansz\appdata\local\programs\python\python39\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\lansz\\AppData\\Local\\Temp\\pip-install-ttc_7ppq\\pyaudio\\setup.py'"'"'; __file__='"'"'C:\\Users\\lansz\\AppData\\Local\\Temp\\pip-install-ttc_7ppq\\pyaudio\\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\lansz\AppData\Local\Temp\pip-wheel-661td9fy'
cwd: C:\Users\lansz\AppData\Local\Temp\pip-install-ttc_7ppq\pyaudio\
Complete output (17 lines):
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win-amd64-3.9
copying src\pyaudio.py -> build\lib.win-amd64-3.9
running build_ext
building '_portaudio' extension
creating build\temp.win-amd64-3.9
creating build\temp.win-amd64-3.9\Release
creating build\temp.win-amd64-3.9\Release\src
C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.16.27023\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DMS_WIN64=1 -Ic:\users\lansz\appdata\local\programs\python\python39\include -Ic:\users\lansz\appdata\local\programs\python\python39\include -IC:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.16.27023\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.win-amd64-3.9\Release\src/_portaudiomodule.obj
_portaudiomodule.c
c:\users\lansz\appdata\local\programs\python\python39\include\pyconfig.h(117): warning C4005: 'MS_WIN64': macro redefinition
src/_portaudiomodule.c: note: see previous definition of 'MS_WIN64'
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\\2017\\BuildTools\\VC\\Tools\\MSVC\\14.16.27023\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2
----------------------------------------
ERROR: Failed building wheel for pyaudio
Running setup.py clean for pyaudio
Failed to build pyaudio
Installing collected packages: pyaudio
Running setup.py install for pyaudio ... error
ERROR: Command errored out with exit status 1:
command: 'c:\users\lansz\appdata\local\programs\python\python39\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\lansz\\AppData\\Local\\Temp\\pip-install-ttc_7ppq\\pyaudio\\setup.py'"'"'; __file__='"'"'C:\\Users\\lansz\\AppData\\Local\\Temp\\pip-install-ttc_7ppq\\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\lansz\AppData\Local\Temp\pip-record-gaglivtc\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\lansz\appdata\local\programs\python\python39\Include\pyaudio'
cwd: C:\Users\lansz\AppData\Local\Temp\pip-install-ttc_7ppq\pyaudio\
Complete output (17 lines):
running install
running build
running build_py
creating build
creating build\lib.win-amd64-3.9
copying src\pyaudio.py -> build\lib.win-amd64-3.9
running build_ext
building '_portaudio' extension
creating build\temp.win-amd64-3.9
creating build\temp.win-amd64-3.9\Release
creating build\temp.win-amd64-3.9\Release\src
C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.16.27023\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DMS_WIN64=1 -Ic:\users\lansz\appdata\local\programs\python\python39\include -Ic:\users\lansz\appdata\local\programs\python\python39\include -IC:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.16.27023\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.win-amd64-3.9\Release\src/_portaudiomodule.obj
_portaudiomodule.c
c:\users\lansz\appdata\local\programs\python\python39\include\pyconfig.h(117): warning C4005: 'MS_WIN64': macro redefinition
src/_portaudiomodule.c: note: see previous definition of 'MS_WIN64'
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\\2017\\BuildTools\\VC\\Tools\\MSVC\\14.16.27023\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2
----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\users\lansz\appdata\local\programs\python\python39\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\lansz\\AppData\\Local\\Temp\\pip-install-ttc_7ppq\\pyaudio\\setup.py'"'"'; __file__='"'"'C:\\Users\\lansz\\AppData\\Local\\Temp\\pip-install-ttc_7ppq\\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\lansz\AppData\Local\Temp\pip-record-gaglivtc\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\lansz\appdata\local\programs\python\python39\Include\pyaudio' Check the logs for full command output.
WARNING: You are using pip version 20.2.3; however, version 21.0.1 is available.
You should consider upgrading via the 'c:\users\lansz\appdata\local\programs\python\python39\python.exe -m pip install --upgrade pip' command.
============================================================
:c
I'm watching btw Tech With Tim's tutorial, the "Coronavirus Webscraper" video.
I don’t know what to do with my life and I’ve been suffering with it for 5 hours.
This might help, since it is the same problem you are having:
pyAudio failed to install : Windows 10
Basically you are missing some components you need before download pyaudio, and those are included by pipwin before installing so you don't have to do it yourself.

Getting error in installing in PyAudio module

After trying countless times I still cannot install PyAudio without getting this error
I have tried using many approaches including pipwin which doesn't get recognized as a real function, how can I install PyAudio?
ERROR: Command errored out with exit status 1:
command: 'C:\person\person\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\person\\AppData\\Local\\Temp\\pip-install-csmluknr\\pyaudio_4df1e1a74cd34515a3cf4ed28ceefeae\\setup.py'"'"'; __file__='"'"'C:\\Users\\person\\AppData\\Local\\Temp\\pip-install-csmluknr\\pyaudio_4df1e1a74cd34515a3cf4ed28ceefeae\\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\person\AppData\Local\Temp\pip-record-tj523gnc\install-record.txt' --single-version-externally-managed --user --prefix= --compile --install-headers 'C:\Users\person\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\Include\PyAudio'
cwd: C:\Users\person\AppData\Local\Temp\pip-install-csmluknr\pyaudio_4df1e1a74cd34515a3cf4ed28ceefeae\
Complete output (17 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
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\Community\VC\Tools\MSVC\14.27.29110\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DMS_WIN64=1 "-IC:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.2544.0_x64__qbz5n2kfra8p0\include" "-IC:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.2544.0_x64__qbz5n2kfra8p0\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\ATLMFC\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\include" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\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/_portaudiomodule.c /Fobuild\temp.win-amd64-3.7\Release\src/_portaudiomodule.obj
_portaudiomodule.c
C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.2544.0_x64__qbz5n2kfra8p0\include\pyconfig.h(117): warning C4005: 'MS_WIN64': macro redefinition
src/_portaudiomodule.c: note: see previous definition of 'MS_WIN64'
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\\Community\\VC\\Tools\\MSVC\\14.27.29110\\bin\\HostX86\\x64\\cl.exe' failed with exit status 2
----------------------------------------
ERROR: Command errored out with exit status 1: 'C:\Users\person\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\person\\AppData\\Local\\Temp\\pip-install-csmluknr\\pyaudio_4df1e1a74cd34515a3cf4ed28ceefeae\\setup.py'"'"'; __file__='"'"'C:\\Users\\person\\AppData\\Local\\Temp\\pip-install-csmluknr\\pyaudio_4df1e1a74cd34515a3cf4ed28ceefeae\\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\person\AppData\Local\Temp\pip-record-tj523gnc\install-record.txt' --single-version-externally-managed --user --prefix= --compile --install-headers 'C:\Users\person\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\Include\PyAudio' Check the logs for full command output.
You can install PyAudio by first installing:
pip install pipwin
Wait until it's done, then:
pipwin install pyaudio
It will work for people who have Python 3.9.
You can download PyAudio wheel file from here.
Then use pip install XXX.whl to install.
For example: pip install E:/PyAudio‑0.2.11‑cp37‑cp37m‑win_amd64.whl
You can check how many bits your computer is, and then download the corresponding wheel.
PyAudio‑0.2.11‑cp37‑cp37m‑win_amd64.whl supports python3.7 for windows 64-bit system.
PyAudio‑0.2.11‑cp37‑cp37m‑win32.whl supports python3.7 for windows 32-bit system.
If Anaconda is installed, we can also use the conda installation tool to install the module "PyAudio" in VSCode: (conda install PyAudio)
Reference: Environment in VSCode.
The suggestion by Aman above works for me, within the Anaconda3 environment, using the Anaconda3 Prompt.
First run this:
pip install pipwin
Then run this:
pipwin install pyaudio
Prior to this, I did install the Microsoft Visual Build Tools. It DID NOT help.
Similar issue found in previous Stackoverflow question.

installing external library on windows 10 goes wrong

I'm trying to install the contractions package (https://pypi.org/project/contractions/) but this error keeps coming up.
Tried installing the Microsoft Visual C++ but it only downloads an installer and then I can't find the specific thing. Can someone help me figure this out?
EDIT: I obviously also tried with just pip install contractions and also with the wheel doc.
C:\Users\CatKa\Documents\MSc\MACHINE LEARNING>python -m pip install contractions
Collecting contractions
Using cached https://files.pythonhosted.org/packages/85/41/c3dfd5feb91a8d587ed1a59f553f07c05f95ad4e5d00ab78702fbf8fe48a/contractions-0.0.24-py2.py3-none-any.whl
Collecting textsearch
Using cached https://files.pythonhosted.org/packages/42/a8/03407021f9555043de5492a2bd7a35c56cc03c2510092b5ec018cae1bbf1/textsearch-0.0.17-py2.py3-none-any.whl
Collecting pyahocorasick
Using cached https://files.pythonhosted.org/packages/f4/9f/f0d8e8850e12829eea2e778f1c90e3c53a9a799b7f412082a5d21cd19ae1/pyahocorasick-1.4.0.tar.gz
Requirement already satisfied: Unidecode in c:\users\catka\anaconda3\lib\site-packages (from textsearch->contractions) (1.1.1)
Building wheels for collected packages: pyahocorasick
Building wheel for pyahocorasick (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: 'C:\Users\CatKa\Anaconda3\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\CatKa\\AppData\\Local\\Temp\\pip-install-5amje9u5\\pyahocorasick\\setup.py'"'"'; __file__='"'"'C:\\Users\\CatKa\\AppData\\Local\\Temp\\pip-install-5amje9u5\\pyahocorasick\\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\CatKa\AppData\Local\Temp\pip-wheel-ky0_mxbr' --python-tag cp37
cwd: C:\Users\CatKa\AppData\Local\Temp\pip-install-5amje9u5\pyahocorasick\
Complete output (5 lines):
running bdist_wheel
running build
running build_ext
building 'ahocorasick' extension
error: Microsoft Visual C++ 14.0 is required. Get it with "Build Tools for Visual Studio": https://visualstudio.microsoft.com/downloads/
----------------------------------------
ERROR: Failed building wheel for pyahocorasick
Running setup.py clean for pyahocorasick
Failed to build pyahocorasick
Installing collected packages: pyahocorasick, textsearch, contractions
Running setup.py install for pyahocorasick ... error
ERROR: Command errored out with exit status 1:
command: 'C:\Users\CatKa\Anaconda3\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\CatKa\\AppData\\Local\\Temp\\pip-install-5amje9u5\\pyahocorasick\\setup.py'"'"'; __file__='"'"'C:\\Users\\CatKa\\AppData\\Local\\Temp\\pip-install-5amje9u5\\pyahocorasick\\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\CatKa\AppData\Local\Temp\pip-record-69ndyre4\install-record.txt' --single-version-externally-managed --compile
cwd: C:\Users\CatKa\AppData\Local\Temp\pip-install-5amje9u5\pyahocorasick\
Complete output (5 lines):
running install
running build
running build_ext
building 'ahocorasick' extension
error: Microsoft Visual C++ 14.0 is required. Get it with "Build Tools for Visual Studio": https://visualstudio.microsoft.com/downloads/
----------------------------------------
ERROR: Command errored out with exit status 1: 'C:\Users\CatKa\Anaconda3\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\CatKa\\AppData\\Local\\Temp\\pip-install-5amje9u5\\pyahocorasick\\setup.py'"'"'; __file__='"'"'C:\\Users\\CatKa\\AppData\\Local\\Temp\\pip-install-5amje9u5\\pyahocorasick\\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\CatKa\AppData\Local\Temp\pip-record-69ndyre4\install-record.txt' --single-version-externally-managed --compile Check the logs for full command output.
EDIT 2:
Installed the Visual C++ like it says (https://www.scivision.co/python-windows-visual-c-14-required/) and also installed Visual C++ 14.0 as provided here (Microsoft Visual C++ 14.0 is required (Unable to find vcvarsall.bat)) but now the error part is even bigger
C:\Users\CatKa\Documents\MSc\MACHINE LEARNING>pip install contractions
Collecting contractions
Using cached https://files.pythonhosted.org/packages/85/41/c3dfd5feb91a8d587ed1a59f553f07c05f95ad4e5d00ab78702fbf8fe48a/contractions-0.0.24-py2.py3-none-any.whl
Collecting textsearch
Using cached https://files.pythonhosted.org/packages/42/a8/03407021f9555043de5492a2bd7a35c56cc03c2510092b5ec018cae1bbf1/textsearch-0.0.17-py2.py3-none-any.whl
Requirement already satisfied: Unidecode in c:\users\catka\anaconda3\lib\site-packages (from textsearch->contractions) (1.1.1)
Collecting pyahocorasick
Using cached https://files.pythonhosted.org/packages/f4/9f/f0d8e8850e12829eea2e778f1c90e3c53a9a799b7f412082a5d21cd19ae1/pyahocorasick-1.4.0.tar.gz
Building wheels for collected packages: pyahocorasick
Building wheel for pyahocorasick (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: 'c:\users\catka\anaconda3\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\CatKa\\AppData\\Local\\Temp\\pip-install-nx9373pl\\pyahocorasick\\setup.py'"'"'; __file__='"'"'C:\\Users\\CatKa\\AppData\\Local\\Temp\\pip-install-nx9373pl\\pyahocorasick\\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\CatKa\AppData\Local\Temp\pip-wheel-mg8rchse' --python-tag cp37
cwd: C:\Users\CatKa\AppData\Local\Temp\pip-install-nx9373pl\pyahocorasick\
Complete output (23 lines):
running bdist_wheel
running build
running build_ext
building 'ahocorasick' extension
creating build
creating build\temp.win-amd64-3.7
creating build\temp.win-amd64-3.7\Release
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DAHOCORASICK_UNICODE= -Ic:\users\catka\anaconda3\include -Ic:\users\catka\anaconda3\include "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-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" /Tcpyahocorasick.c /Fobuild\temp.win-amd64-3.7\Release\pyahocorasick.obj
pyahocorasick.c
c:\users\catka\appdata\local\temp\pip-install-nx9373pl\pyahocorasick\Automaton_pickle.c(363): warning C4018: '<': signed/unsigned mismatch
c:\users\catka\appdata\local\temp\pip-install-nx9373pl\pyahocorasick\Automaton_pickle.c(422): warning C4018: '<': signed/unsigned mismatch
c:\users\catka\appdata\local\temp\pip-install-nx9373pl\pyahocorasick\Automaton_pickle.c(473): warning C4018: '<': signed/unsigned mismatch
c:\users\catka\appdata\local\temp\pip-install-nx9373pl\pyahocorasick\Automaton_pickle.c(483): warning C4018: '<': signed/unsigned mismatch
c:\users\catka\appdata\local\temp\pip-install-nx9373pl\pyahocorasick\src/custompickle/load/loadbuffer.c(68): warning C4146: unary minus operator applied to unsigned type, result still unsigned
c:\users\catka\appdata\local\temp\pip-install-nx9373pl\pyahocorasick\src/custompickle/load/module_automaton_load.c(89): warning C4267: '=': conversion from 'size_t' to 'int', possible loss of data
creating C:\Users\CatKa\AppData\Local\Temp\pip-install-nx9373pl\pyahocorasick\build\lib.win-amd64-3.7
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\link.exe /nologo /INCREMENTAL:NO /LTCG /DLL /MANIFEST:EMBED,ID=2 /MANIFESTUAC:NO /LIBPATH:c:\users\catka\anaconda3\libs /LIBPATH:c:\users\catka\anaconda3\PCbuild\amd64 "/LIBPATH:C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\LIB\amd64" "/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" /EXPORT:PyInit_ahocorasick build\temp.win-amd64-3.7\Release\pyahocorasick.obj /OUT:build\lib.win-amd64-3.7\ahocorasick.cp37-win_amd64.pyd /IMPLIB:build\temp.win-amd64-3.7\Release\ahocorasick.cp37-win_amd64.lib
pyahocorasick.obj : warning LNK4197: export 'PyInit_ahocorasick' specified multiple times; using first specification
Creating library build\temp.win-amd64-3.7\Release\ahocorasick.cp37-win_amd64.lib and object build\temp.win-amd64-3.7\Release\ahocorasick.cp37-win_amd64.exp
Generating code
Finished generating code
LINK : fatal error LNK1158: cannot run 'rc.exe'
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\x86_amd64\\link.exe' failed with exit status 1158
----------------------------------------
ERROR: Failed building wheel for pyahocorasick
Running setup.py clean for pyahocorasick
Failed to build pyahocorasick
Installing collected packages: pyahocorasick, textsearch, contractions
Running setup.py install for pyahocorasick ... error
ERROR: Command errored out with exit status 1:
command: 'c:\users\catka\anaconda3\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\CatKa\\AppData\\Local\\Temp\\pip-install-nx9373pl\\pyahocorasick\\setup.py'"'"'; __file__='"'"'C:\\Users\\CatKa\\AppData\\Local\\Temp\\pip-install-nx9373pl\\pyahocorasick\\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\CatKa\AppData\Local\Temp\pip-record-82y3clbc\install-record.txt' --single-version-externally-managed --compile
cwd: C:\Users\CatKa\AppData\Local\Temp\pip-install-nx9373pl\pyahocorasick\
Complete output (23 lines):
running install
running build
running build_ext
building 'ahocorasick' extension
creating build
creating build\temp.win-amd64-3.7
creating build\temp.win-amd64-3.7\Release
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DAHOCORASICK_UNICODE= -Ic:\users\catka\anaconda3\include -Ic:\users\catka\anaconda3\include "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-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" /Tcpyahocorasick.c /Fobuild\temp.win-amd64-3.7\Release\pyahocorasick.obj
pyahocorasick.c
c:\users\catka\appdata\local\temp\pip-install-nx9373pl\pyahocorasick\Automaton_pickle.c(363): warning C4018: '<': signed/unsigned mismatch
c:\users\catka\appdata\local\temp\pip-install-nx9373pl\pyahocorasick\Automaton_pickle.c(422): warning C4018: '<': signed/unsigned mismatch
c:\users\catka\appdata\local\temp\pip-install-nx9373pl\pyahocorasick\Automaton_pickle.c(473): warning C4018: '<': signed/unsigned mismatch
c:\users\catka\appdata\local\temp\pip-install-nx9373pl\pyahocorasick\Automaton_pickle.c(483): warning C4018: '<': signed/unsigned mismatch
c:\users\catka\appdata\local\temp\pip-install-nx9373pl\pyahocorasick\src/custompickle/load/loadbuffer.c(68): warning C4146: unary minus operator applied to unsigned type, result still unsigned
c:\users\catka\appdata\local\temp\pip-install-nx9373pl\pyahocorasick\src/custompickle/load/module_automaton_load.c(89): warning C4267: '=': conversion from 'size_t' to 'int', possible loss of data
creating C:\Users\CatKa\AppData\Local\Temp\pip-install-nx9373pl\pyahocorasick\build\lib.win-amd64-3.7
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\link.exe /nologo /INCREMENTAL:NO /LTCG /DLL /MANIFEST:EMBED,ID=2 /MANIFESTUAC:NO /LIBPATH:c:\users\catka\anaconda3\libs /LIBPATH:c:\users\catka\anaconda3\PCbuild\amd64 "/LIBPATH:C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\LIB\amd64" "/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" /EXPORT:PyInit_ahocorasick build\temp.win-amd64-3.7\Release\pyahocorasick.obj /OUT:build\lib.win-amd64-3.7\ahocorasick.cp37-win_amd64.pyd /IMPLIB:build\temp.win-amd64-3.7\Release\ahocorasick.cp37-win_amd64.lib
pyahocorasick.obj : warning LNK4197: export 'PyInit_ahocorasick' specified multiple times; using first specification
Creating library build\temp.win-amd64-3.7\Release\ahocorasick.cp37-win_amd64.lib and object build\temp.win-amd64-3.7\Release\ahocorasick.cp37-win_amd64.exp
Generating code
Finished generating code
LINK : fatal error LNK1158: cannot run 'rc.exe'
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\x86_amd64\\link.exe' failed with exit status 1158
----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\users\catka\anaconda3\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\CatKa\\AppData\\Local\\Temp\\pip-install-nx9373pl\\pyahocorasick\\setup.py'"'"'; __file__='"'"'C:\\Users\\CatKa\\AppData\\Local\\Temp\\pip-install-nx9373pl\\pyahocorasick\\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\CatKa\AppData\Local\Temp\pip-record-82y3clbc\install-record.txt' --single-version-externally-managed --compile Check the logs for full command output.
I received the same error using pip installation and tried "conda Channel" for installation and it is successful.
Try below commands in the Powershell prompt of Anaconda Navigator
conda config --add channels conda-forge
conda install pyahocorasick
it works for me after installing build tools for visual studio c++ 14.0

Categories