This question already has an answer here:
pip install pyaudio error cl.exe failed
(1 answer)
Closed 3 years ago.
I tried to install PyAudio but facing following errors:
Collecting PyAudio
Using cached PyAudio-0.2.11.tar.gz (37 kB)
Installing collected packages: PyAudio
Running setup.py install for PyAudio ... error
ERROR: Command errored out with exit status 1:
command: 'c:\python3.8\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\pizhlo21\\AppData\\Local\\Temp\\pip-install-5pn6g8qb\\PyAudio\\setup.py'"'"'; __file__='"'"'C:\\Users\\pizhlo21\\AppData\\Local\\Temp\\pip-install-5pn6g8qb\\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\pizhlo21\AppData\Local\Temp\pip-record-zv7fvd9r\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\python3.8\Include\PyAudio'
cwd: C:\Users\pizhlo21\AppData\Local\Temp\pip-install-5pn6g8qb\PyAudio\
Complete output (15 lines):
running install
running build
running build_py
creating build
creating build\lib.win32-3.8
copying src\pyaudio.py -> build\lib.win32-3.8
running build_ext
building '_portaudio' extension
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\2019\Community\VC\Tools\MSVC\14.24.28314\bin\HostX86\x86\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Ic:\python3.8\include -Ic:\python3.8\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.24.28314\ATLMFC\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.24.28314\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.win32-3.8\Release\src/_portaudiomodule.obj
_portaudiomodule.c
src/_portaudiomodule.c(29): fatal error C1083: ЌҐ г¤ Ґвбп ®вЄалвм д ©« ўЄ«о票Ґ: portaudio.h: No such file or directory,
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.24.28314\\bin\\HostX86\\x86\\cl.exe' failed with exit status 2
----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\python3.8\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\pizhlo21\\AppData\\Local\\Temp\\pip-install-5pn6g8qb\\PyAudio\\setup.py'"'"'; __file__='"'"'C:\\Users\\pizhlo21\\AppData\\Local\\Temp\\pip-install-5pn6g8qb\\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\pizhlo21\AppData\Local\Temp\pip-record-zv7fvd9r\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\python3.8\Include\PyAudio' Check the logs for full command output.
python version 3.8
pip version 20.0.2
Please help me in finding a solution. Thanks!
You need install Visual Studio 2019. No file at C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.24.28314\bin\HostX86\x86\cl.exe and etc.
Related
I am running:
pip install PyAudio
I get this output:
C:\Users\graymouse\PycharmProjects\EmailBot>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\graymouse\appdata\local\programs\python\python39\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\graymouse\\AppData\\Local\\Temp
\\pip-install-q96wwkqf\\pyaudio_a5b98de520a84c63ad40636eaf059e91\\setup.py'"'"'; __file__='"'"'C:\\Users\\graymouse\\AppData\\Local\\Temp\\pip-install-q96wwkqf\\pyaudio_a5b98de520a84c63ad
40636eaf059e91\\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\graymouse\AppData\Local\Temp\pip-record-064zortn\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\graymouse\app
data\local\programs\python\python39\Include\PyAudio'
cwd: C:\Users\graymouse\AppData\Local\Temp\pip-install-q96wwkqf\pyaudio_a5b98de520a84c63ad40636eaf059e91\
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\graymouse\a
ppdata\local\programs\python\python39\include -Ic:\users\graymouse\appdata\local\programs\python\python39\include -IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools
\MSVC\14.28.29333\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 -IC:\Program Files (x86)\Windows 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\graymouse\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 code 2
----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\users\graymouse\appdata\local\programs\python\python39\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users
\\graymouse\\AppData\\Local\\Temp\\pip-install-q96wwkqf\\pyaudio_a5b98de520a84c63ad40636eaf059e91\\setup.py'"'"'; __file__='"'"'C:\\Users\\graymouse\\AppData\\Local\\Temp\\pip-install-q96
wwkqf\\pyaudio_a5b98de520a84c63ad40636eaf059e91\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compi
le(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\graymouse\AppData\Local\Temp\pip-record-064zortn\install-record.txt' --single-version-externally-managed --compile --instal
l-headers 'c:\users\graymouse\appdata\local\programs\python\python39\Include\PyAudio' Check the logs for full command output.
Go to https://www.lfd.uci.edu/~gohlke/pythonlibs/#pyaudio and download PyAudio‑0.2.11‑cp39‑cp39‑win_amd64.whl
Then go to the folder where it is downloaded using cd
pip install PyAudio‑0.2.11‑cp39‑cp39‑win_amd64.whl
I was trying
pip install pyaudio
But I got an error
Collecting pyaudio
Using cached PyAudio-0.2.11.tar.gz (37 kB)
Installing collected packages: pyaudio
Running setup.py install for pyaudio: started
Running setup.py install for pyaudio: finished with status 'error'
ERROR: Command errored out with exit status 1:
command: 'C:\Users\Admin\PycharmProjects\AI\venv\Scripts\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Admin\\AppData\\Local\\Temp\\pycharm-packaging\\pyaudio\\setup.py'"'"'; __file__='"'"'C:\\Users\\Admin\\AppData\\Local\\Temp\\pycharm-packaging\\pyaudio\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\Admin\AppData\Local\Temp\pip-record-9rgu21ro\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\Admin\PycharmProjects\AI\venv\include\site\python3.8\pyaudio'
cwd: C:\Users\Admin\AppData\Local\Temp\pycharm-packaging\pyaudio\
Complete output (17 lines):
running install
running build
running build_py
creating build
creating build\lib.win32-3.8
copying src\pyaudio.py -> build\lib.win32-3.8
warning: build_py: byte-compiling is disabled, skipping.
running build_ext
building '_portaudio' extension
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\2019\BuildTools\VC\Tools\MSVC\14.25.28610\bin\HostX86\x86\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -IC:\Users\Admin\PycharmProjects\AI\venv\include -IC:\Users\Admin\AppData\Local\Programs\Python\Python38-32\include -IC:\Users\Admin\AppData\Local\Programs\Python\Python38-32\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.25.28610\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" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\cppwinrt" /Tcsrc/_portaudiomodule.c /Fobuild\temp.win32-3.8\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.25.28610\\bin\\HostX86\\x86\\cl.exe' failed with exit status 2
----------------------------------------
ERROR: Command errored out with exit status 1: 'C:\Users\Admin\PycharmProjects\AI\venv\Scripts\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\Admin\AppData\Local\Temp\pycharm-packaging\pyaudio\setup.py'"'"'; file='"'"'C:\Users\Admin\AppData\Local\Temp\pycharm-packaging\pyaudio\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record 'C:\Users\Admin\AppData\Local\Temp\pip-record-9rgu21ro\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\Admin\PycharmProjects\AI\venv\include\site\python3.8\pyaudio' Check the logs for full command output.
You must use python versions 2.7, 3.4, 3.6 otherwise there will be an error.supporting python versions
I downloaded this version 'https://www.python.org/downloads/release/python-2717/' of python and it was able to install pyaudio.
pyaudio installed
If you have several versions of Python, then for example to run pip for Python 2.7.17 use this command:
py -2 -m pip install pyaudio
module pyaudio
I want to write a script that continuously checks a certain directory on a Mac OS for changing files. When I google for possible solutions I came upon MacFSEvents. However, when I try to pip install macfsevents I get the following error code:
Collecting macfsevents
Using cached https://files.pythonhosted.org/packages/28/2e/1ff399cfd2a6a8ebb65152203c920643c2169aa507b2e96559d19baeb7c3/MacFSEvents-0.8.1.tar.gz
Installing collected packages: macfsevents
Running setup.py install for macfsevents ... error
ERROR: Command errored out with exit status 1:
command: 'c:\users\nllsme\appdata\local\programs\python\python38\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\nllsme\\AppData\\Local\\Temp\\pip-install-g5oqxirm\\macfsevents\\setup.py'"'"'; __file__='"'"'C:\\Users\\nllsme\\AppData\\Local\\Temp\\pip-install-g5oqxirm\\macfsevents\\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\nllsme\AppData\Local\Temp\pip-record-_hqmm2_b\install-record.txt' --single-version-externally-managed --compile
cwd: C:\Users\nllsme\AppData\Local\Temp\pip-install-g5oqxirm\macfsevents\
Complete output (14 lines):
running install
running build
running build_py
creating build
creating build\lib.win-amd64-3.8
copying fsevents.py -> build\lib.win-amd64-3.8
running build_ext
building '_fsevents' extension
creating build\temp.win-amd64-3.8
creating build\temp.win-amd64-3.8\Release
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Ic:\users\nllsme\appdata\local\programs\python\python38\include -Ic:\users\nllsme\appdata\local\programs\python\python38\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\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" /Tc_fsevents.c /Fobuild\temp.win-amd64-3.8\Release\_fsevents.obj
_fsevents.c
_fsevents.c(2): fatal error C1083: Cannot open include file: 'CoreFoundation/CoreFoundation.h': No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\x86_amd64\\cl.exe' failed with exit status 2
----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\users\nllsme\appdata\local\programs\python\python38\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\nllsme\\AppData\\Local\\Temp\\pip-install-g5oqxirm\\macfsevents\\setup.py'"'"'; __file__='"'"'C:\\Users\\nllsme\\AppData\\Local\\Temp\\pip-install-g5oqxirm\\macfsevents\\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\nllsme\AppData\Local\Temp\pip-record-_hqmm2_b\install-record.txt' --single-version-externally-managed --compile Check the logs for full command output.
Is there any way I can solve this installation issue or reach my goal using another API?
After installing pyaudio on windows I get this error:
ERROR: Command errored out with exit status 1:
command: 'c:\users\asus\appdata\local\programs\python\python38\python.exe' -u -c 'import
sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\ASUS\\AppData\\Local\\Temp\\pip-install-02do7ejp\\pyaudio\\setup.py'"'"'; __file__='"'"'C:\\Users\\ASUS\\AppData\\Local\\Temp\\pip-install-02do7ejp\\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\ASUS\AppData\Local\Temp\pip-record-yfv9cuts\install-record.txt' --single-version-externally-managed --compile
cwd: C:\Users\ASUS\AppData\Local\Temp\pip-install-02do7ejp\pyaudio\
Complete output (17 lines):
running install
running build
running build_py
creating build
creating build\lib.win-amd64-3.8
copying src\pyaudio.py -> build\lib.win-amd64-3.8
running build_ext
building '_portaudio' extension
creating build\temp.win-amd64-3.8
creating build\temp.win-amd64-3.8\Release
creating build\temp.win-amd64-3.8\Release\src
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DMS_WIN64=1 -Ic:\users\asus\appdata\local\programs\python\python38\include -Ic:\users\asus\appdata\local\programs\python\python38\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\ATLMFC\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2017\Community\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.8\Release\src/_portaudiomodule.obj
_portaudiomodule.c
c:\users\asus\appdata\local\programs\python\python38\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\\Community\\VC\\Tools\\MSVC\\14.16.27023\\bin\\HostX86\\x64\\cl.exe' failed with exit status 2
----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\users\asus\appdata\local\programs\python\python38\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\ASUS\\AppData\\Local\\Temp\\pip-install-02do7ejp\\pyaudio\\setup.py'"'"'; __file__='"'"'C:\\Users\\ASUS\\AppData\\Local\\Temp\\pip-install-02do7ejp\\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\ASUS\AppData\Local\Temp\pip-record-yfv9cuts\install-record.txt' --single-version-externally-managed --compile Check the logs for full command output.
Has anyone faced a similar problem? If so, please let me now how you solved it.
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