I'm trying to use object detection models from Tensorflow and need to get pycocotools installed. I'm doing this from a python (3) virtual environment on a Windows 10 machine. There seems to be some known issues around getting this working on Windows, and I'm pretty sure I've tried them all.
I've tried pip-installing pycocotools, with this error (fails building wheel):
(env) PS C:\Users\la01043601\ML_CameraVision\humanDetection> pip install pycocotools
Collecting pycocotools
Using cached pycocotools-2.0.2.tar.gz (23 kB)
Requirement already satisfied: setuptools>=18.0 in c:\users\la01043601\ml_cameravision\humandetection\env\lib\site-packages (from pycocotools) (56.0.0)
Requirement already satisfied: cython>=0.27.3 in c:\users\la01043601\ml_cameravision\humandetection\env\lib\site-packages (from pycocotools) (0.29.23)
Requirement already satisfied: matplotlib>=2.1.0 in c:\users\la01043601\ml_cameravision\humandetection\env\lib\site-packages (from pycocotools) (3.4.2)
Requirement already satisfied: pyparsing>=2.2.1 in c:\users\la01043601\ml_cameravision\humandetection\env\lib\site-packages (from matplotlib>=2.1.0->pycocotools) (2.4.7)
Requirement already satisfied: cycler>=0.10 in c:\users\la01043601\ml_cameravision\humandetection\env\lib\site-packages (from matplotlib>=2.1.0->pycocotools) (0.10.0)
Requirement already satisfied: pillow>=6.2.0 in c:\users\la01043601\ml_cameravision\humandetection\env\lib\site-packages (from matplotlib>=2.1.0->pycocotools) (8.2.0)
Requirement already satisfied: numpy>=1.16 in c:\users\la01043601\ml_cameravision\humandetection\env\lib\site-packages (from matplotlib>=2.1.0->pycocotools) (1.19.5)
Requirement already satisfied: kiwisolver>=1.0.1 in c:\users\la01043601\ml_cameravision\humandetection\env\lib\site-packages (from matplotlib>=2.1.0->pycocotools) (1.3.1)
Requirement already satisfied: python-dateutil>=2.7 in c:\users\la01043601\ml_cameravision\humandetection\env\lib\site-packages (from matplotlib>=2.1.0->pycocotools) (2.8.1)
Requirement already satisfied: six in c:\users\la01043601\ml_cameravision\humandetection\env\lib\site-packages (from cycler>=0.10->matplotlib>=2.1.0->pycocotools) (1.15.0)
Building wheels for collected packages: pycocotools
Building wheel for pycocotools (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: 'c:\users\la01043601\ml_cameravision\humandetection\env\scripts\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\la01043601\\AppData\\Local\\Temp\\pip-install-hjka7e0k\\pycocotools_91d3c7ee2ad946f292455cc0fc685c5f\\setup.py'"'"'; __file__='"'"'C:\\Users\\la01043601\\AppData\\Local\\Temp\\pip-install-hjka7e0k\\pycocotools_91d3c7ee2ad946f292455cc0fc685c5f\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d 'C:\Users\la01043601\AppData\Local\Temp\pip-wheel-i_wesduj'
cwd: C:\Users\la01043601\AppData\Local\Temp\pip-install-hjka7e0k\pycocotools_91d3c7ee2ad946f292455cc0fc685c5f\
Complete output (23 lines):
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win-amd64-3.9
creating build\lib.win-amd64-3.9\pycocotools
copying pycocotools\coco.py -> build\lib.win-amd64-3.9\pycocotools
copying pycocotools\cocoeval.py -> build\lib.win-amd64-3.9\pycocotools
copying pycocotools\mask.py -> build\lib.win-amd64-3.9\pycocotools
copying pycocotools\__init__.py -> build\lib.win-amd64-3.9\pycocotools
running build_ext
cythoning pycocotools/_mask.pyx to pycocotools\_mask.c
c:\users\la01043601\ml_cameravision\humandetection\env\lib\site-packages\Cython\Compiler\Main.py:369: FutureWarning: Cython directive 'language_level' not set, using 2 for now (Py2). This will change in a later release! File: C:\Users\la01043601\AppData\Local\Temp\pip-install-hjka7e0k\pycocotools_91d3c7ee2ad946f292455cc0fc685c5f\pycocotools\_mask.pyx
tree = Parsing.p_module(s, pxd, full_module_name)
building 'pycocotools._mask' extension
creating build\temp.win-amd64-3.9
creating build\temp.win-amd64-3.9\Release
creating build\temp.win-amd64-3.9\Release\common
creating build\temp.win-amd64-3.9\Release\pycocotools
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 -Ic:\users\la01043601\ml_cameravision\humandetection\env\lib\site-packages\numpy\core\include -I./common -Ic:\users\la01043601\ml_cameravision\humandetection\env\include -IC:\Python39\include -IC:\Python39\include -IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30037\ATLMFC\include -IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30037\include /Tc./common/maskApi.c /Fobuild\temp.win-amd64-3.9\Release\./common/maskApi.obj
maskApi.c
./common/maskApi.c(8): fatal error C1083: Cannot open include file: 'math.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 code 2
----------------------------------------
ERROR: Failed building wheel for pycocotools
Running setup.py clean for pycocotools
Failed to build pycocotools
Installing collected packages: pycocotools
Running setup.py install for pycocotools ... error
ERROR: Command errored out with exit status 1:
command: 'c:\users\la01043601\ml_cameravision\humandetection\env\scripts\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\la01043601\\AppData\\Local\\Temp\\pip-install-hjka7e0k\\pycocotools_91d3c7ee2ad946f292455cc0fc685c5f\\setup.py'"'"'; __file__='"'"'C:\\Users\\la01043601\\AppData\\Local\\Temp\\pip-install-hjka7e0k\\pycocotools_91d3c7ee2ad946f292455cc0fc685c5f\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\la01043601\AppData\Local\Temp\pip-record-crzypf9k\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\la01043601\ml_cameravision\humandetection\env\include\site\python3.9\pycocotools'
cwd: C:\Users\la01043601\AppData\Local\Temp\pip-install-hjka7e0k\pycocotools_91d3c7ee2ad946f292455cc0fc685c5f\
Complete output (21 lines):
running install
running build
running build_py
creating build
creating build\lib.win-amd64-3.9
creating build\lib.win-amd64-3.9\pycocotools
copying pycocotools\coco.py -> build\lib.win-amd64-3.9\pycocotools
copying pycocotools\cocoeval.py -> build\lib.win-amd64-3.9\pycocotools
copying pycocotools\mask.py -> build\lib.win-amd64-3.9\pycocotools
copying pycocotools\__init__.py -> build\lib.win-amd64-3.9\pycocotools
running build_ext
skipping 'pycocotools\_mask.c' Cython extension (up-to-date)
building 'pycocotools._mask' extension
creating build\temp.win-amd64-3.9
creating build\temp.win-amd64-3.9\Release
creating build\temp.win-amd64-3.9\Release\common
creating build\temp.win-amd64-3.9\Release\pycocotools
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 -Ic:\users\la01043601\ml_cameravision\humandetection\env\lib\site-packages\numpy\core\include -I./common -Ic:\users\la01043601\ml_cameravision\humandetection\env\include -IC:\Python39\include -IC:\Python39\include -IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30037\ATLMFC\include -IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30037\include /Tc./common/maskApi.c /Fobuild\temp.win-amd64-3.9\Release\./common/maskApi.obj
maskApi.c
./common/maskApi.c(8): fatal error C1083: Cannot open include file: 'math.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 code 2
----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\users\la01043601\ml_cameravision\humandetection\env\scripts\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\la01043601\\AppData\\Local\\Temp\\pip-install-hjka7e0k\\pycocotools_91d3c7ee2ad946f292455cc0fc685c5f\\setup.py'"'"'; __file__='"'"'C:\\Users\\la01043601\\AppData\\Local\\Temp\\pip-install-hjka7e0k\\pycocotools_91d3c7ee2ad946f292455cc0fc685c5f\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\la01043601\AppData\Local\Temp\pip-record-crzypf9k\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\la01043601\ml_cameravision\humandetection\env\include\site\python3.9\pycocotools' Check the logs for full command output.
I've tried the fix from Phil Ferriere's repository (still fails building wheel, something with math.h file not found):
(env) PS C:\Users\la01043601\ML_CameraVision\humanDetection> pip install git+https://github.com/philferriere/cocoapi.git#subdirectory=PythonAPI
Collecting git+https://github.com/philferriere/cocoapi.git#subdirectory=PythonAPI
Cloning https://github.com/philferriere/cocoapi.git to c:\users\la01043601\appdata\local\temp\pip-req-build-htao1r08
Running command git clone -q https://github.com/philferriere/cocoapi.git 'C:\Users\la01043601\AppData\Local\Temp\pip-req-build-htao1r08'
Building wheels for collected packages: pycocotools
Building wheel for pycocotools (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: 'c:\users\la01043601\ml_cameravision\humandetection\env\scripts\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\la01043601\\AppData\\Local\\Temp\\pip-req-build-htao1r08\\PythonAPI\\setup.py'"'"'; __file__='"'"'C:\\Users\\la01043601\\AppData\\Local\\Temp\\pip-req-build-htao1r08\\PythonAPI\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d 'C:\Users\la01043601\AppData\Local\Temp\pip-wheel-kktx8s70'
cwd: C:\Users\la01043601\AppData\Local\Temp\pip-req-build-htao1r08\PythonAPI
Complete output (20 lines):
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win-amd64-3.9
creating build\lib.win-amd64-3.9\pycocotools
copying pycocotools\coco.py -> build\lib.win-amd64-3.9\pycocotools
copying pycocotools\cocoeval.py -> build\lib.win-amd64-3.9\pycocotools
copying pycocotools\mask.py -> build\lib.win-amd64-3.9\pycocotools
copying pycocotools\__init__.py -> build\lib.win-amd64-3.9\pycocotools
running build_ext
building 'pycocotools._mask' extension
creating build\temp.win-amd64-3.9
creating build\temp.win-amd64-3.9\common
creating build\temp.win-amd64-3.9\Release
creating build\temp.win-amd64-3.9\Release\pycocotools
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 -Ic:\users\la01043601\ml_cameravision\humandetection\env\lib\site-packages\numpy\core\include -I../common -Ic:\users\la01043601\ml_cameravision\humandetection\env\include -IC:\Python39\include -IC:\Python39\include -IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30037\ATLMFC\include -IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30037\include /Tc../common/maskApi.c /Fobuild\temp.win-amd64-3.9\Release\../common/maskApi.obj
maskApi.c
../common/maskApi.c(8): fatal error C1083: Cannot open include file: 'math.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 code 2
----------------------------------------
ERROR: Failed building wheel for pycocotools
Running setup.py clean for pycocotools
ERROR: Command errored out with exit status 1:
command: 'c:\users\la01043601\ml_cameravision\humandetection\env\scripts\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\la01043601\\AppData\\Local\\Temp\\pip-req-build-htao1r08\\PythonAPI\\setup.py'"'"'; __file__='"'"'C:\\Users\\la01043601\\AppData\\Local\\Temp\\pip-req-build-htao1r08\\PythonAPI\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' clean --all
cwd: C:\Users\la01043601\AppData\Local\Temp\pip-req-build-htao1r08
Complete output (11 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\la01043601\AppData\Local\Temp\pip-req-build-htao1r08\PythonAPI\setup.py", line 25, in <module>
cythonize(ext_modules)
File "c:\users\la01043601\ml_cameravision\humandetection\env\lib\site-packages\Cython\Build\Dependencies.py", line 965, in cythonize
module_list, module_metadata = create_extension_list(
File "c:\users\la01043601\ml_cameravision\humandetection\env\lib\site-packages\Cython\Build\Dependencies.py", line 815, in create_extension_list
for file in nonempty(sorted(extended_iglob(filepattern)), "'%s' doesn't match any files" % filepattern):
File "c:\users\la01043601\ml_cameravision\humandetection\env\lib\site-packages\Cython\Build\Dependencies.py", line 114, in nonempty
raise ValueError(error_msg)
ValueError: 'pycocotools/_mask.pyx' doesn't match any files
----------------------------------------
ERROR: Failed cleaning build dir for pycocotools
Failed to build pycocotools
Installing collected packages: pycocotools
Running setup.py install for pycocotools ... error
ERROR: Command errored out with exit status 1:
command: 'c:\users\la01043601\ml_cameravision\humandetection\env\scripts\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\la01043601\\AppData\\Local\\Temp\\pip-req-build-htao1r08\\PythonAPI\\setup.py'"'"'; __file__='"'"'C:\\Users\\la01043601\\AppData\\Local\\Temp\\pip-req-build-htao1r08\\PythonAPI\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\la01043601\AppData\Local\Temp\pip-record-ok0x1q7g\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\la01043601\ml_cameravision\humandetection\env\include\site\python3.9\pycocotools'
cwd: C:\Users\la01043601\AppData\Local\Temp\pip-req-build-htao1r08\PythonAPI
Complete output (9 lines):
running install
running build
running build_py
running build_ext
building 'pycocotools._mask' extension
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 -Ic:\users\la01043601\ml_cameravision\humandetection\env\lib\site-packages\numpy\core\include -I../common -Ic:\users\la01043601\ml_cameravision\humandetection\env\include -IC:\Python39\include -IC:\Python39\include -IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30037\ATLMFC\include -IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30037\include /Tc../common/maskApi.c /Fobuild\temp.win-amd64-3.9\Release\../common/maskApi.obj
maskApi.c
../common/maskApi.c(8): fatal error C1083: Cannot open include file: 'math.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 code 2
----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\users\la01043601\ml_cameravision\humandetection\env\scripts\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\la01043601\\AppData\\Local\\Temp\\pip-req-build-htao1r08\\PythonAPI\\setup.py'"'"'; __file__='"'"'C:\\Users\\la01043601\\AppData\\Local\\Temp\\pip-req-build-htao1r08\\PythonAPI\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\la01043601\AppData\Local\Temp\pip-record-ok0x1q7g\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\la01043601\ml_cameravision\humandetection\env\include\site\python3.9\pycocotools' Check the logs for full command output.
I've tried installing Visual C++ Build Tools (2015 version recommended by many other answers), but got the error that it was unable to find/download setup package, so I've made sure I have updates to the 2019 build tools, and they are added to my path.
Error I was getting is like this one. I also followed the video at the bottom of that solution and it didn't help.
I've tried using the suggested windows install for pycocotools (pycocotools-windows), which gives the following error:
(env) PS C:\Users\la01043601\ML_CameraVision\humanDetection> pip install cocoapi-windows
ERROR: Could not find a version that satisfies the requirement cocoapi-windows (from versions: none)
ERROR: No matching distribution found for cocoapi-windows
(env) PS C:\Users\la01043601\ML_CameraVision\humanDetection> pip install pycocotools-windows
ERROR: Could not find a version that satisfies the requirement pycocotools-windows (from versions: none)
ERROR: No matching distribution found for pycocotools-windows
Python and pip are on my Windows path. I gave up on one tutorial due to this, just to find the next one has a pycocotools dependency too.
(Also accepting suggestions for Tensorflow object detection tutorials that do not use pycocotools! Need a decent tutorial because I'm a beginner).
Edit: Have now also tried running the setup.py file the following way, still having issues with not finding a math.h file...
(env) PS C:\Users\la01043601\ML_CameraVision\humanDetection\sandbox\cocoapi\PythonAPI> python setup.py build_ext --inplace
Compiling pycocotools/_mask.pyx because it changed.
[1/1] Cythonizing pycocotools/_mask.pyx
C:\Users\la01043601\ML_CameraVision\humanDetection\env\lib\site-packages\Cython\Compiler\Main.py:369: FutureWarning: Cython directive 'language_level' not set, using 2 for now (Py2). This will change in a later release! File: C:\Users\la01043601\ML_CameraVision\humanDetection\sandbox\cocoapi\PythonAPI\pycocotools\_mask.pyx
tree = Parsing.p_module(s, pxd, full_module_name)
running build_ext
building 'pycocotools._mask' extension
creating build
creating build\temp.win-amd64-3.9
creating build\temp.win-amd64-3.9\common
creating build\temp.win-amd64-3.9\Release
creating build\temp.win-amd64-3.9\Release\pycocotools
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 -IC:\Users\la01043601\ML_CameraVision\humanDetection\env\lib\site-packages\numpy\core\include -I../common -IC:\Users\la01043601\ML_CameraVision\humanDetection\env\include -IC:\Python39\include -IC:\Python39\include -IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30037\ATLMFC\include -IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30037\include /Tc../common/maskApi.c /Fobuild\temp.win-amd64-3.9\Release\../common/maskApi.obj
maskApi.c
../common/maskApi.c(8): fatal error C1083: Cannot open include file: 'math.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 code 2
Edit edit I forgot to mention that in the past couple days I also tried troubleshooting the math.h error, which suggests switching an include statement from "math.h" to "cmath", and using "quotes" instead of angle brackets, and since this happens when installing from a downloaded repo I even forked the repo the made the change on my version to download from there. Error as follows (now related to a missing 'crtdbg.h' file and I don't understand how everything works under the hood in Build Tools):
(env) PS C:\Users\la01043601\ML_CameraVision\humanDetection> pip install git+https://github.com/Broccoli-Hunter/cocoapi.git#subdirectory=PythonAPI
Collecting git+https://github.com/Broccoli-Hunter/cocoapi.git#subdirectory=PythonAPI
Cloning https://github.com/Broccoli-Hunter/cocoapi.git to c:\users\la01043601\appdata\local\temp\pip-req-build-atepfcnd
Running command git clone -q https://github.com/Broccoli-Hunter/cocoapi.git 'C:\Users\la01043601\AppData\Local\Temp\pip-req-build-atepfcnd'
Building wheels for collected packages: pycocotools
Building wheel for pycocotools (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: 'c:\users\la01043601\ml_cameravision\humandetection\env\scripts\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\la01043601\\AppData\\Local\\Temp\\pip-req-build-atepfcnd\\PythonAPI\\setup.py'"'"'; __file__='"'"'C:\\Users\\la01043601\\AppData\\Local\\Temp\\pip-req-build-atepfcnd\\PythonAPI\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d 'C:\Users\la01043601\AppData\Local\Temp\pip-wheel-4bje9txk'
cwd: C:\Users\la01043601\AppData\Local\Temp\pip-req-build-atepfcnd\PythonAPI
Complete output (20 lines):
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win-amd64-3.9
creating build\lib.win-amd64-3.9\pycocotools
copying pycocotools\coco.py -> build\lib.win-amd64-3.9\pycocotools
copying pycocotools\cocoeval.py -> build\lib.win-amd64-3.9\pycocotools
copying pycocotools\mask.py -> build\lib.win-amd64-3.9\pycocotools
copying pycocotools\__init__.py -> build\lib.win-amd64-3.9\pycocotools
running build_ext
building 'pycocotools._mask' extension
creating build\temp.win-amd64-3.9
creating build\temp.win-amd64-3.9\common
creating build\temp.win-amd64-3.9\Release
creating build\temp.win-amd64-3.9\Release\pycocotools
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 -Ic:\users\la01043601\ml_cameravision\humandetection\env\lib\site-packages\numpy\core\include -I../common -Ic:\users\la01043601\ml_cameravision\humandetection\env\include -IC:\Python39\include -IC:\Python39\include -IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30037\ATLMFC\include -IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30037\include /Tc../common/maskApi.c /Fobuild\temp.win-amd64-3.9\Release\../common/maskApi.obj
maskApi.c
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30037\include\yvals.h(12): fatal error C1083: Cannot open include file: 'crtdbg.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 code 2
----------------------------------------
ERROR: Failed building wheel for pycocotools
Running setup.py clean for pycocotools
ERROR: Command errored out with exit status 1:
command: 'c:\users\la01043601\ml_cameravision\humandetection\env\scripts\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\la01043601\\AppData\\Local\\Temp\\pip-req-build-atepfcnd\\PythonAPI\\setup.py'"'"'; __file__='"'"'C:\\Users\\la01043601\\AppData\\Local\\Temp\\pip-req-build-atepfcnd\\PythonAPI\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' clean --all
cwd: C:\Users\la01043601\AppData\Local\Temp\pip-req-build-atepfcnd
Complete output (11 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\la01043601\AppData\Local\Temp\pip-req-build-atepfcnd\PythonAPI\setup.py", line 25, in <module>
cythonize(ext_modules)
File "c:\users\la01043601\ml_cameravision\humandetection\env\lib\site-packages\Cython\Build\Dependencies.py", line 965, in cythonize
module_list, module_metadata = create_extension_list(
File "c:\users\la01043601\ml_cameravision\humandetection\env\lib\site-packages\Cython\Build\Dependencies.py", line 815, in create_extension_list
for file in nonempty(sorted(extended_iglob(filepattern)), "'%s' doesn't match any files" % filepattern):
File "c:\users\la01043601\ml_cameravision\humandetection\env\lib\site-packages\Cython\Build\Dependencies.py", line 114, in nonempty
raise ValueError(error_msg)
ValueError: 'pycocotools/_mask.pyx' doesn't match any files
----------------------------------------
ERROR: Failed cleaning build dir for pycocotools
Failed to build pycocotools
I managed to install pycocotools only after downloading the installer from this link and installing these:
me too! I ran "pip install pycocotools" on Linux, same error like this:
running build_ext
creating build/temp.linux-x86_64-3.7
creating build/temp.linux-x86_64-3.7/common
creating build/temp.linux-x86_64-3.7/pycocotools
gcc -pthread -B /home/ppp/anaconda3/envs/openmmlab/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/tmp/pip-build-env-qzv5sdb4/overlay/lib/python3.7/site-packages/numpy/core/include -I./common -I/home/ppp/anaconda3/envs/openmmlab/include/python3.7m -c ./common/maskApi.c -o build/temp.linux-x86_64-3.7/./common/maskApi.o -Wno-cpp -Wno-unused-function -std=c99
./common/maskApi.c:8:18: fatal error: math.h: No such file or directory
compilation terminated.
error: command '/usr/bin/gcc' failed with exit code 1
----------------------------------------
ERROR: Failed building wheel for pycocotools
Failed to build pycocotools
ERROR: Could not build wheels for pycocotools which use PEP 517 and cannot be installed directly
I solved the problem by conda install pycocotools -c conda-forge
ps: python version==3.7.12
after everything failed, I installed visual c++ build tools using the link below
Visit https://myvs.download.prss.microsoft.com/db/mu_visual_cpp_build_tools_2015_update_3_x64_dvd_dfd9a39c.iso?t=36429cde-dc63-4657-8114-1c74ae0da9bf&e=1645739068&h=e153f9afa2fa5fd4ffae5a1cc714a2ab704115af952dfb82e1761e5553c7999a&su=1
after it has downloaded open it and run the setup file, everything should run smoothly.
Then in your environment run this code:-
pip install cython
then this one:
pip install git+https://github.com/philferriere/cocoapi.git#subdirectory=PythonAPI
that should work, I am using TensorFlow version 2.3, Python 3.8
You may need to install:
sudo apt install python3.9-dev
Place another python version if you need 3.8 etc.
Then pycocotools is installed correctly, helped in my case when "Python.h" was not found.
Don't Forget to Restart your pc after install visual c++ build tools, in my case everything not working until I restart my PC after installing the build tools.
I've installed GMP 5.x , PBC (latest) and OPENSSL but when I try `pip3 install charm-crypto this error occurs. If anyone knows how to solve this error because I don't understand it please tell me? By the way the error is much longer than this but I couldn't paste it, It is mostly repeating the process of copying
(venv) C:\Users\admin\PycharmProjects\Testing>pip3 install charm-crypto
Collecting charm-crypto
Using cached Charm-Crypto-0.43.tar.gz (364 kB)
Requirement already satisfied: setuptools in c:\users\admin\pycharmprojects\testing\venv\lib\site-packages (from charm-crypto) (50.3.2)
Requirement already satisfied: pyparsing>=1.5.5 in c:\users\admin\pycharmprojects\testing\venv\lib\site-packages (from charm-crypto) (2.4.7)
Using legacy 'setup.py install' for charm-crypto, since package 'wheel' is not installed.
Installing collected packages: charm-crypto
Running setup.py install for charm-crypto ... error
ERROR: Command errored out with exit status 1:
command: 'c:\users\admin\pycharmprojects\testing\venv\scripts\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\admin\\AppData\
\Local\\Temp\\pip-install-83yi7s_w\\charm-crypto\\setup.py'"'"'; __file__='"'"'C:\\Users\\admin\\AppData\\Local\\Temp\\pip-install-83yi7s_w\\charm-crypto\\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-vq3a6qkl\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users
\admin\pycharmprojects\testing\venv\include\site\python3.9\charm-crypto'
cwd: C:\Users\admin\AppData\Local\Temp\pip-install-83yi7s_w\charm-crypto\
Complete output (194 lines):
Platform: Windows
Config file: config.mk
Warning, using default config vaules.
You probably want to run ./configure.sh first.
running install
running build
running build_py
creating build
creating build\lib.win-amd64-3.9
creating build\lib.win-amd64-3.9\charm
copying charm\config.py -> build\lib.win-amd64-3.9\charm
copying charm\__init__.py -> build\lib.win-amd64-3.9\charm
creating build\lib.win-amd64-3.9\charm\core
copying charm\core\__init__.py -> build\lib.win-amd64-3.9\charm\core
creating build\lib.win-amd64-3.9\charm\core\crypto
copying charm\core\crypto\__init__.py -> build\lib.win-amd64-3.9\charm\core\crypto
copying charm\adapters\abenc_adapt_hybrid.py -> build\lib.win-amd64-3.9\charm\adapters
copying charm\adapters\dabenc_adapt_hybrid.py -> build\lib.win-amd64-3.9\charm\adapters
copying charm\adapters\ibenc_adapt_hybrid.py -> build\lib.win-amd64-3.9\charm\adapters
copying charm\adapters\ibenc_adapt_identityhash.py -> build\lib.win-amd64-3.9\charm\adapters
copying charm\adapters\kpabenc_adapt_hybrid.py -> build\lib.win-amd64-3.9\charm\adapters
copying charm\adapters\pkenc_adapt_bchk05.py -> build\lib.win-amd64-3.9\charm\adapters
copying charm\adapters\pkenc_adapt_chk04.py -> build\lib.win-amd64-3.9\charm\adapters
copying charm\adapters\pkenc_adapt_hybrid.py -> build\lib.win-amd64-3.9\charm\adapters
copying charm\adapters\pksig_adapt_naor01.py -> build\lib.win-amd64-3.9\charm\adapters
copying charm\adapters\__init__.py -> build\lib.win-amd64-3.9\charm\adapters
running build_ext
building 'charm.core.math.pairing' extension
creating build\temp.win-amd64-3.9
creating build\temp.win-amd64-3.9\Release
creating build\temp.win-amd64-3.9\Release\charm
creating build\temp.win-amd64-3.9\Release\charm\core
creating build\temp.win-amd64-3.9\Release\charm\core\benchmark
creating build\temp.win-amd64-3.9\Release\charm\core\math
creating build\temp.win-amd64-3.9\Release\charm\core\math\pairing
creating build\temp.win-amd64-3.9\Release\charm\core\utilities
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 -DBENCHMARK_E
NABLED=1 -Icharm/core/utilities/ -Icharm/core/benchmark/ -Ic:\users\admin\pycharmprojects\testing\venv\include -IC:\Users\admin\AppData\Local\Programs\Python\Python3
9\include -IC:\Users\admin\AppData\Local\Programs\Python\Python39\include -IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.28.29333\
ATLMFC\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 Fi
les (x86)\Windows Kits\10\include\10.0.18362.0\winrt -IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\cppwinrt /Tccharm/core/benchmark/benchmarkmodule.c
/Fobuild\temp.win-amd64-3.9\Release\charm/core/benchmark/benchmarkmodule.obj
benchmarkmodule.c
C:\Users\admin\AppData\Local\Temp\pip-install-83yi7s_w\charm-crypto\charm\core\benchmark\benchmarkmodule.h(12): fatal error C1083: Impossible d'ouvrir le fichier
includeÿ: 'sys/time.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 cod
e 2
----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\users\admin\pycharmprojects\testing\venv\scripts\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0]
= '"'"'C:\\Users\\admin\\AppData\\Local\\Temp\\pip-install-83yi7s_w\\charm-crypto\\setup.py'"'"'; __file__='"'"'C:\\Users\\admin\\AppData\\Local\\Temp\\pip-install-8
3yi7s_w\\charm-crypto\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(c
ode, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\admin\AppData\Local\Temp\pip-record-vq3a6qkl\install-record.txt' --single-version-externally-managed --co
mpile --install-headers 'c:\users\admin\pycharmprojects\testing\venv\include\site\python3.9\charm-crypto' Check the logs for full command output.
The problem is there is file with code which is not compatible with MSVC. sys/time.h is included in benchmarkmodule.h and unfortunately this file does not exit in MSVC.
Try to install mingw, set the CC to mingw compiler and run the pip3 command . If it still not working you can try to build it directly like explained in https://jhuisi.github.io/charm/install_source.html.
In all cases you will need a mingw compiler. However, it may be complicated.
You will need to install the msvc redistributable. When you run the make command, f you face the error Unknown MS Compiler version 1927. modify the cygwinccompiler.py file by adding :
#custom add
elif msc_ver == '1927':
# VS2019 / MSVC 16.7
return ['msvcr100']
#custom add
before the last add.
You may also need to add a file distutils.cfg like explained in https://wiki.python.org/moin/WindowsCompilers. Once these modifications done, the compilation should start normally.
Perhaps the easiest would be to compile it under linux.
After doing pip install pyaudio, It started collecting the package but suddenly it displayed this error. Hope the following explains what's going on:
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:\Users\mayank\AppData\Local\Programs\Python\Python38-32\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\mayank\\AppData\\Local\\Temp\\pip-install-b1kw0ltr\\pyaudio\\setup.py'"'"'; __file__='"'"'C:\\Users\\mayank\\AppData\\Local\\Temp\\pip-install-b1kw0ltr\\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\mayank\AppData\Local\Temp\pip-record-s8qn1fa4\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\mayank\AppData\Local\Programs\Python\Python38-32\Include\pyaudio'
cwd: C:\Users\mayank\AppData\Local\Temp\pip-install-b1kw0ltr\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\BuildTools\VC\Tools\MSVC\14.25.28610\bin\HostX86\x86\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -IC:\Users\mayank\AppData\Local\Programs\Python\Python38-32\include -IC:\Users\mayank\AppData\Local\Programs\Python\Python38-32\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.25.28610\include" /Tcsrc/_portaudiomodule.c /Fobuild\temp.win32-3.8\Release\src/_portaudiomodule.obj
_portaudiomodule.c
src/_portaudiomodule.c(27): fatal error C1083: Cannot open include file: 'stdio.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\mayank\AppData\Local\Programs\Python\Python38-32\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\mayank\\AppData\\Local\\Temp\\pip-install-b1kw0ltr\\pyaudio\\setup.py'"'"'; __file__='"'"'C:\\Users\\mayank\\AppData\\Local\\Temp\\pip-install-b1kw0ltr\\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\mayank\AppData\Local\Temp\pip-record-s8qn1fa4\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\mayank\AppData\Local\Programs\Python\Python38-32\Include\pyaudio' Check the logs for full command output.
brew install portaudio
Then:
brew link portaudio
pip install pyAudio
Or if you are using windows:
Go to: https://www.lfd.uci.edu/~gohlke/pythonlibs/#pyaudio
Download the file and then go to its directory in the cmd and type:
For win 32 bit:
pip install PyAudio‑0.2.11‑cp37‑cp37m‑win32.whl
For win 64 bit:
pip install PyAudio‑0.2.11‑cp38‑cp38‑win_amd64.whl
For windows-
https://www.lfd.uci.edu/~gohlke/pythonlibs/#pyaudio
press ctrl + f and search pyaudio and scroll down
Download any version of this if you are using 64 bit-
PyAudio‑0.2.11‑cp39‑cp39‑win_amd64.whl
or download any version of this if you are using 32 bit -
PyAudio‑0.2.11‑cp39‑cp39‑win32.whl
go to the file location of the downloaded file and press Shift + Right click
select open command window here
then copy the file name and paste like pip install "file name" for e.g-
pip install PyAudio‑0.2.11‑cp39‑cp39‑win_amd64.whl
If you are working on Ubunutu/Linux try below.
It worked for me
sudo apt-get install portaudio19-dev
pip install pyaudio
You have to download the pyAudio file manually and put it in a directory and cd to the same directory and run the given command.
I had the same issue and fixed it using pipwin:
pip install pipwin
pipwin install pyaudio
I keep getting this while trying to install PyGObject for Python 3.7 in Pycharm. I at first got the error where cl.exe couldn't be found, but I did some research and would that apparently C++ toolkit was missing even though I could locate cl.exe. I reinstalled pip, toolkit, and added cl.exe to PATH, and this new error came up:
ERROR: Command errored out with exit status 1
Command:
Collecting PyGObject
Using cached PyGObject-3.36.0.tar.gz (714 kB)
Installing build dependencies: started
Installing build dependencies: finished with status 'error'
ERROR: Command errored out with exit status 1:
command: 'C:\Users\Latitude\PycharmProjects\ESC190\project_scheduler\venv\Scripts\python.exe'
'C:\Users\Latitude\PycharmProjects\ESC190\project_scheduler\venv\lib\site-packages\pip' install --
ignore-installed --no-user --prefix 'C:\Users\Latitude\AppData\Local\Temp\pip-build-env-
gv8msoqy\overlay' --no-warn-script-location --no-binary :none: --only-binary :none: -i
https://pypi.org/simple -- setuptools wheel pycairo
cwd: None
Complete output (35 lines):
Collecting setuptools
Using cached setuptools-46.1.3-py3-none-any.whl (582 kB)
Collecting wheel
Using cached wheel-0.34.2-py2.py3-none-any.whl (26 kB)
Collecting pycairo
Using cached pycairo-1.19.1.tar.gz (205 kB)
Installing collected packages: setuptools, wheel, pycairo
Running setup.py install for pycairo: started
Running setup.py install for pycairo: finished with status 'error'
ERROR: Command errored out with exit status 1:
command: 'C:\Users\Latitude\PycharmProjects\ESC190\project_scheduler\venv\Scripts\python.exe' -u -
c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Latitude\\AppData\\Local\\Temp\\pip-install-i870hprp\\pycairo\\setup.py'"'"'; __file__='"'"'C:\\Users\\Latitude\\AppData\\Local\\Temp\\pip-install-i870hprp\\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\Latitude\AppData\Local\Temp\pip-record-si_3ert2\install-record.txt' --single-version-externally-managed --prefix 'C:\Users\Latitude\AppData\Local\Temp\pip-build-env-gv8msoqy\overlay' --compile --install-headers 'C:\Users\Latitude\PycharmProjects\ESC190\project_scheduler\venv\include\site\python3.7\pycairo'
cwd: C:\Users\Latitude\AppData\Local\Temp\pip-install-i870hprp\pycairo\
Complete output (20 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
warning: build_py: byte-compiling is disabled, skipping.
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\Community\VC\Tools\MSVC\14.24.28314\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL
/DNDEBUG /MT -DPYCAIRO_VERSION_MAJOR=1 -DPYCAIRO_VERSION_MINOR=19 -DPYCAIRO_VERSION_MICRO=1 -
IC:\Users\Latitude\PycharmProjects\ESC190\project_scheduler\venv\include -IC:\Users\Latitude\AppData\Local\Programs\Python\Python37\include -IC:\Users\Latitude\AppData\Local\Programs\Python\Python37\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" /Tccairo/device.c /Fobuild\temp.win-amd64-3.7\Release\cairo/device.obj
device.c
C:\Users\Latitude\AppData\Local\Temp\pip-install-i870hprp\pycairo\cairo\pycairo.h(37): fatal error C1083: Cannot open include file: 'cairo.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\\x64\\cl.exe' failed with exit status 2
----------------------------------------
ERROR: Command errored out with exit status 1: 'C:\Users\Latitude\PycharmProjects\ESC190\project_scheduler\venv\Scripts\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Latitude\\AppData\\Local\\Temp\\pip-install-i870hprp\\pycairo\\setup.py'"'"'; __file__='"'"'C:\\Users\\Latitude\\AppData\\Local\\Temp\\pip-install-i870hprp\\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\Latitude\AppData\Local\Temp\pip-record-si_3ert2\install-record.txt' --single-version-externally-managed --prefix 'C:\Users\Latitude\AppData\Local\Temp\pip-build-env-gv8msoqy\overlay' --compile --install-headers 'C:\Users\Latitude\PycharmProjects\ESC190\project_scheduler\venv\include\site\python3.7\pycairo' Check the logs for full command output.
----------------------------------------
ERROR: Command errored out with exit status 1:
'C:\Users\Latitude\PycharmProjects\ESC190\project_scheduler\venv\Scripts\python.exe'
'C:\Users\Latitude\PycharmProjects\ESC190\project_scheduler\venv\lib\site-packages\pip' install --ignore-installed --no-user --prefix 'C:\Users\Latitude\AppData\Local\Temp\pip-build-env-gv8msoqy\overlay' --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- setuptools wheel pycairo Check the logs for full command output.
I was getting same error while installing pywhatkit. I used pip install --upgrade pip setuptools wheel --user first then installed pywhatkit using command pip install pywhatkit and it worked.
delete windows temp files and add this argument to the end of the install command --no-cache-dir
if it didn't work try to install tokenize module first
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 !