python count find pyaudio - python

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.

Related

"c1xx: fatal error C1083: Cannot open source file: 'cld3/pycld3.cpp': No such file or directory" when installing pycld3 with pip

I am trying to install cld3 with pip on Python 3.9. I have successfully installed protoc and also got the C++ build tools with Visual Studio, however when I run py -m pip install -U pycld3 it fails with a few messages. I am on windows 10 running Python 3.9
It initially fails to build using wheel:
Collecting pycld3
Using cached pycld3-0.21.tar.gz (652 kB)
Building wheels for collected packages: pycld3
Building wheel for pycld3 (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: 'C:\Users\Charlie\AppData\Local\Programs\Python\Python39\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Charlie\\AppData\\Local\\Temp\\pip-install-hl9cd_fj\\pycld3_6beaeb0f5dd847eab99d4f8bff3bd60a\\setup.py'"'"'; __file__='"'"'C:\\Users\\Charlie\\AppData\\Local\\Temp\\pip-install-hl9cd_fj\\pycld3_6beaeb0f5dd847eab99d4f8bff3bd60a\\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\Charlie\AppData\Local\Temp\pip-wheel-_9ez3o7a'
cwd: C:\Users\Charlie\AppData\Local\Temp\pip-install-hl9cd_fj\pycld3_6beaeb0f5dd847eab99d4f8bff3bd60a\
Complete output (23 lines):
running bdist_wheel
running build
Creating dirs at C:\Users\Charlie\AppData\Local\Temp\pip-install-hl9cd_fj\pycld3_6beaeb0f5dd847eab99d4f8bff3bd60a\src/cld_3/protos/
This is not surprising as it mentions in the docs that wheel installation is not supported for my OS. However I really do not understand what happens next:
Running protoc sentence.proto feature_extractor.proto task_spec.proto --cpp_out=C:\Users\Charlie\AppData\Local\Temp\pip-install-hl9cd_fj\pycld3_6beaeb0f5dd847eab99d4f8bff3bd60a\src/cld_3/protos/
running build_py
creating build
creating build\lib.win-amd64-3.9
creating build\lib.win-amd64-3.9\cld3
copying cld3\__init__.py -> build\lib.win-amd64-3.9\cld3
running build_ext
building 'cld3._cld3' extension
creating build\temp.win-amd64-3.9
creating build\temp.win-amd64-3.9\Release
creating build\temp.win-amd64-3.9\Release\cld3
creating build\temp.win-amd64-3.9\Release\src
creating build\temp.win-amd64-3.9\Release\src\cld_3
creating build\temp.win-amd64-3.9\Release\src\cld_3\protos
creating build\temp.win-amd64-3.9\Release\src\script_span
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -I/usr/local/include/ -IC:\Users\Charlie\AppData\Local\Temp\pip-install-hl9cd_fj\pycld3_6beaeb0f5dd847eab99d4f8bff3bd60a\src/ -IC:\Users\Charlie\AppData\Local\Temp\pip-install-hl9cd_fj\pycld3_6beaeb0f5dd847eab99d4f8bff3bd60a\src/cld_3/protos/ -IC:\Users\Charlie\AppData\Local\Programs\Python\Python39\include -IC:\Users\Charlie\AppData\Local\Programs\Python\Python39\include -IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\ATLMFC\include -IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\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 /EHsc /Tpcld3/pycld3.cpp /Fobuild\temp.win-amd64-3.9\Release\cld3/pycld3.obj -std=c++11
cl : Command line warning D9002 : ignoring unknown option '-std=c++11'
pycld3.cpp
c1xx: fatal error C1083: Cannot open source file: 'cld3/pycld3.cpp': No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.28.29333\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2
----------------------------------------
ERROR: Failed building wheel for pycld3
Running setup.py clean for pycld3
Failed to build pycld3
Installing collected packages: pycld3
Running setup.py install for pycld3 ... error
ERROR: Command errored out with exit status 1:
command: 'C:\Users\Charlie\AppData\Local\Programs\Python\Python39\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Charlie\\AppData\\Local\\Temp\\pip-install-hl9cd_fj\\pycld3_6beaeb0f5dd847eab99d4f8bff3bd60a\\setup.py'"'"'; __file__='"'"'C:\\Users\\Charlie\\AppData\\Local\\Temp\\pip-install-hl9cd_fj\\pycld3_6beaeb0f5dd847eab99d4f8bff3bd60a\\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\Charlie\AppData\Local\Temp\pip-record-fkxpsotm\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\Charlie\AppData\Local\Programs\Python\Python39\Include\pycld3'
cwd: C:\Users\Charlie\AppData\Local\Temp\pip-install-hl9cd_fj\pycld3_6beaeb0f5dd847eab99d4f8bff3bd60a\
Complete output (22 lines):
running install
running build
Running protoc sentence.proto feature_extractor.proto task_spec.proto --cpp_out=C:\Users\Charlie\AppData\Local\Temp\pip-install-hl9cd_fj\pycld3_6beaeb0f5dd847eab99d4f8bff3bd60a\src/cld_3/protos/
running build_py
creating build
creating build\lib.win-amd64-3.9
creating build\lib.win-amd64-3.9\cld3
copying cld3\__init__.py -> build\lib.win-amd64-3.9\cld3
running build_ext
building 'cld3._cld3' extension
creating build\temp.win-amd64-3.9
creating build\temp.win-amd64-3.9\Release
creating build\temp.win-amd64-3.9\Release\cld3
creating build\temp.win-amd64-3.9\Release\src
creating build\temp.win-amd64-3.9\Release\src\cld_3
creating build\temp.win-amd64-3.9\Release\src\cld_3\protos
creating build\temp.win-amd64-3.9\Release\src\script_span
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -I/usr/local/include/ -IC:\Users\Charlie\AppData\Local\Temp\pip-install-hl9cd_fj\pycld3_6beaeb0f5dd847eab99d4f8bff3bd60a\src/ -IC:\Users\Charlie\AppData\Local\Temp\pip-install-hl9cd_fj\pycld3_6beaeb0f5dd847eab99d4f8bff3bd60a\src/cld_3/protos/ -IC:\Users\Charlie\AppData\Local\Programs\Python\Python39\include -IC:\Users\Charlie\AppData\Local\Programs\Python\Python39\include -IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\ATLMFC\include -IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\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 /EHsc /Tpcld3/pycld3.cpp /Fobuild\temp.win-amd64-3.9\Release\cld3/pycld3.obj -std=c++11
cl : Command line warning D9002 : ignoring unknown option '-std=c++11'
pycld3.cpp
c1xx: fatal error C1083: Cannot open source file: 'cld3/pycld3.cpp': No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\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\Charlie\AppData\Local\Programs\Python\Python39\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Charlie\\AppData\\Local\\Temp\\pip-install-hl9cd_fj\\pycld3_6beaeb0f5dd847eab99d4f8bff3bd60a\\setup.py'"'"'; __file__='"'"'C:\\Users\\Charlie\\AppData\\Local\\Temp\\pip-install-hl9cd_fj\\pycld3_6beaeb0f5dd847eab99d4f8bff3bd60a\\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\Charlie\AppData\Local\Temp\pip-record-fkxpsotm\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\Charlie\AppData\Local\Programs\Python\Python39\Include\pycld3' Check the logs for full command output.
As far as I can tell it is because it cannot find "cld3/pycld3.cpp"". Do I need to run an earlier version of Python? Thanks in advance
This is a bug in pycld3: they've forgotten to include the source into sdist. Please report the bug.
Meanwhile the workaround is to install Cython:
pip install Cython
pip install pycld3
[pycld3 maintainer] This issue should be resolved in pycld3 release 0.22.
python3 -m pip install -U pycld3
As #phd points out, this was an error with the distribution upload in 0.21 that neglected to include the intermediate .cpp file. Inclusion of that file in the sdist should not be dependent on the build-time logic of whether a user has or wants to use Cython.
Note that in the 0.22 release, the installation will respect the environment variable USE_CYTHON=1. You must have an existing install of Cython to use this flag. It will force re-compilation from the source .pyx file. This follows the behavior recommended at Distributing Cython Modules.
0.22 also drops support for end-of-life Python 3.5 and no longer passes the unsupported -std=c++11 on Windows MSVC.
Detail: full changelog from 0.21 to 0.22.

How to check for file changes on Mac OS using python

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?

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

Intalling pycairo with Python 3.7 on Windows

I'm trying to install pycairo, and in spite of what I found on the Internet, I don't manage to to it
I did pip install pycairo, but it askek me to install Visual Basic Build Tool. I did it but it doesn't work then. I tried a lot of ideas found on the web (e.g. with this website https://www.lfd.uci.edu/~gohlke/pythonlibs/), but it also didn't work.
When I try pip install pycairo, the error message is :
Collecting pycairo
Using cached https://files.pythonhosted.org/packages/48/20/5e83af98eb897935bf7dc39455e892ba866feebb9b7c3b392982866f9958/pycairo-1.18.1.tar.gz
Installing collected packages: pycairo
Running setup.py install for pycairo ... error
ERROR: Command errored out with exit status 1:
command: 'd:\programmes\python\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Thomas\\AppData\\Local\\Temp\\pip-install-58_68_s2\\pycairo\\setup.py'"'"'; __file__='"'"'C:\\Users\\Thomas\\AppData\\Local\\Temp\\pip-install-58_68_s2\\pycairo\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\Thomas\AppData\Local\Temp\pip-record-6wtp6mn1\install-record.txt' --single-version-externally-managed --compile
cwd: C:\Users\Thomas\AppData\Local\Temp\pip-install-58_68_s2\pycairo\
Complete output (18 lines):
running install
running build
running build_py
creating build
creating build\lib.win-amd64-3.7
creating build\lib.win-amd64-3.7\cairo
copying cairo\__init__.py -> build\lib.win-amd64-3.7\cairo
copying cairo\__init__.pyi -> build\lib.win-amd64-3.7\cairo
copying cairo\py.typed -> build\lib.win-amd64-3.7\cairo
running build_ext
building 'cairo._cairo' extension
creating build\temp.win-amd64-3.7
creating build\temp.win-amd64-3.7\Release
creating build\temp.win-amd64-3.7\Release\cairo
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.21.27702\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MT -DPYCAIRO_VERSION_MAJOR=1 -DPYCAIRO_VERSION_MINOR=18 -DPYCAIRO_VERSION_MICRO=1 -Id:\programmes\python\include -Id:\programmes\python\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.21.27702\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" /Tccairo/device.c /Fobuild\temp.win-amd64-3.7\Release\cairo/device.obj
device.c
C:\Users\Thomas\AppData\Local\Temp\pip-install-58_68_s2\pycairo\cairo\pycairo.h(37): fatal error C1083: Impossible d'ouvrir le fichier includeÿ: 'cairo.h'ÿ: No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Tools\\MSVC\\14.21.27702\\bin\\HostX86\\x64\\cl.exe' failed with exit status 2
----------------------------------------
ERROR: Command errored out with exit status 1: 'd:\programmes\python\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Thomas\\AppData\\Local\\Temp\\pip-install-58_68_s2\\pycairo\\setup.py'"'"'; __file__='"'"'C:\\Users\\Thomas\\AppData\\Local\\Temp\\pip-install-58_68_s2\\pycairo\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\Thomas\AppData\Local\Temp\pip-record-6wtp6mn1\install-record.txt' --single-version-externally-managed --compile Check the logs for full command output.
And I don't understant it !
installing libraries can be a little tough on Windows.
I usually use this website :
https://www.lfd.uci.edu/~gohlke/pythonlibs/
Then, search for your package (here : pycairo‑1.18.1‑cp37‑cp37m‑win_amd64.whl)
Then, you launch cmd in the folder where you downloaded the file, and execute :
pip install pycairo‑1.18.1‑cp37‑cp37m‑win_amd64.whl
I hope this will help you !

when i try to install pyaudio it gives me this huge error

I wrote a assistant and it says:
please build and install the portaudio python bindings first
And when i want to install pyaudio it gives a huge error message
ERROR: Complete output from command 'c:\users\degin\appdata\local\programs\python\python37-32\python.exe' -u -c 'import setuptools, tokenize;__file__='"'"'C:\\Users\\degin\\AppData\\Local\\Temp\\pip-install-zos6mmry\\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\degin\AppData\Local\Temp\pip-record-3d78nl9h\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\2017\Community\VC\Tools\MSVC\14.14.26428\bin\HostX86\x86\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Ic:\users\degin\appdata\local\programs\python\python37-32\include -Ic:\users\degin\appdata\local\programs\python\python37-32\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.14.26428\include" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.16299.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\\2017\\Community\\VC\\Tools\\MSVC\\14.14.26428\\bin\\HostX86\\x86\\cl.exe' failed with exit status 2
----------------------------------------
ERROR: Command "'c:\users\degin\appdata\local\programs\python\python37-32\python.exe' -u -c 'import setuptools, tokenize;__file__='"'"'C:\\Users\\degin\\AppData\\Local\\Temp\\pip-install-zos6mmry\\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\degin\AppData\Local\Temp\pip-record-3d78nl9h\install-record.txt' --single-version-externally-managed --compile" failed with error code 1 in C:\Users\degin\AppData\Local\Temp\pip-install-zos6mmry\pyaudio\
My assistant start to work, it says only one line of conversation and the exits with this:
And when i want to install pyaudio it gives a huge error message

Categories

Resources