I am trying to install pycocotools and pyk4a for Azure Kinect DK on Windows 11. But I get error
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\x86_amd64\\cl.exe' failed with exit code 2
and full error for pycocotools installation
C:\Users\borguser>pip install pycocotools
Defaulting to user installation because normal site-packages is not writeable
Collecting pycocotools
Using cached pycocotools-2.0.6.tar.gz (24 kB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... done
Requirement already satisfied: numpy in c:\program files\python38\lib\site-packages (from pycocotools) (1.23.2)
Requirement already satisfied: matplotlib>=2.1.0 in c:\program files\python38\lib\site-packages (from pycocotools) (3.5.3)
Requirement already satisfied: kiwisolver>=1.0.1 in c:\program files\python38\lib\site-packages (from matplotlib>=2.1.0->pycocotools) (1.4.4)
Requirement already satisfied: fonttools>=4.22.0 in c:\program files\python38\lib\site-packages (from matplotlib>=2.1.0->pycocotools) (4.36.0)
Requirement already satisfied: pillow>=6.2.0 in c:\program files\python38\lib\site-packages (from matplotlib>=2.1.0->pycocotools) (9.2.0)
Requirement already satisfied: packaging>=20.0 in c:\program files\python38\lib\site-packages (from matplotlib>=2.1.0->pycocotools) (21.3)
Requirement already satisfied: cycler>=0.10 in c:\program files\python38\lib\site-packages (from matplotlib>=2.1.0->pycocotools) (0.11.0)
Requirement already satisfied: pyparsing>=2.2.1 in c:\program files\python38\lib\site-packages (from matplotlib>=2.1.0->pycocotools) (3.0.9)
Requirement already satisfied: python-dateutil>=2.7 in c:\program files\python38\lib\site-packages (from matplotlib>=2.1.0->pycocotools) (2.8.2)
Requirement already satisfied: six>=1.5 in c:\users\borguser\appdata\roaming\python\python38\site-packages (from python-dateutil>=2.7->matplotlib>=2.1.0->pycocotools) (1.16.0)
Building wheels for collected packages: pycocotools
Building wheel for pycocotools (pyproject.toml) ... error
error: subprocess-exited-with-error
× Building wheel for pycocotools (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [26 lines of output]
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win-amd64-cpython-38
creating build\lib.win-amd64-cpython-38\pycocotools
copying pycocotools\coco.py -> build\lib.win-amd64-cpython-38\pycocotools
copying pycocotools\cocoeval.py -> build\lib.win-amd64-cpython-38\pycocotools
copying pycocotools\mask.py -> build\lib.win-amd64-cpython-38\pycocotools
copying pycocotools\__init__.py -> build\lib.win-amd64-cpython-38\pycocotools
running build_ext
cythoning pycocotools/_mask.pyx to pycocotools\_mask.c
building 'pycocotools._mask' extension
creating build\temp.win-amd64-cpython-38
creating build\temp.win-amd64-cpython-38\Release
creating build\temp.win-amd64-cpython-38\Release\common
creating build\temp.win-amd64-cpython-38\Release\pycocotools
"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -IC:\Users\borguser\AppData\Local\Temp\pip-build-env-k52plwlf\overlay\Lib\site-packages\numpy\core\include -I./common "-Ic:\program files\python38\include" "-Ic:\program files\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.10240.0\ucrt" /Tc./common/maskApi.c /Fobuild\temp.win-amd64-cpython-38\Release\./common/maskApi.obj
maskApi.c
./common/maskApi.c(151): warning C4101: 'xp': unreferenced local variable
"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -IC:\Users\borguser\AppData\Local\Temp\pip-build-env-k52plwlf\overlay\Lib\site-packages\numpy\core\include -I./common "-Ic:\program files\python38\include" "-Ic:\program files\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.10240.0\ucrt" /Tcpycocotools\_mask.c /Fobuild\temp.win-amd64-cpython-38\Release\pycocotools\_mask.obj
_mask.c
c:\program files\python38\include\pyconfig.h(205): fatal error C1083: Cannot open include file: 'basetsd.h': No such file or directory
C:\Users\borguser\AppData\Local\Temp\pip-build-env-k52plwlf\overlay\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\borguser\AppData\Local\Temp\pip-install-3xblwin5\pycocotools_9ab1e0da77ee47ac9bd67dee17627376\pycocotools\_mask.pyx
tree = Parsing.p_module(s, pxd, full_module_name)
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\x86_amd64\\cl.exe' failed with exit code 2
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for pycocotools
Failed to build pycocotools
ERROR: Could not build
full error for py4ka installation
C:\Users\borguser>pip install pyk4a
Defaulting to user installation because normal site-packages is not writeable
Collecting pyk4a
Using cached pyk4a-1.5.0.tar.gz (24 kB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... done
Requirement already satisfied: numpy in c:\program files\python38\lib\site-packages (from pyk4a) (1.23.2)
Building wheels for collected packages: pyk4a
Building wheel for pyk4a (pyproject.toml) ... error
error: subprocess-exited-with-error
× Building wheel for pyk4a (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [31 lines of output]
Automatically detected kinect SDK. Adding include dir: C:\Program Files\Azure Kinect SDK v1.4.1\sdk\include and library dir C:\Program Files\Azure Kinect SDK v1.4.1\sdk\windows-desktop\AMD64\release\lib.
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win-amd64-cpython-38
creating build\lib.win-amd64-cpython-38\pyk4a
copying pyk4a\calibration.py -> build\lib.win-amd64-cpython-38\pyk4a
copying pyk4a\capture.py -> build\lib.win-amd64-cpython-38\pyk4a
copying pyk4a\config.py -> build\lib.win-amd64-cpython-38\pyk4a
copying pyk4a\errors.py -> build\lib.win-amd64-cpython-38\pyk4a
copying pyk4a\module.py -> build\lib.win-amd64-cpython-38\pyk4a
copying pyk4a\playback.py -> build\lib.win-amd64-cpython-38\pyk4a
copying pyk4a\pyk4a.py -> build\lib.win-amd64-cpython-38\pyk4a
copying pyk4a\record.py -> build\lib.win-amd64-cpython-38\pyk4a
copying pyk4a\results.py -> build\lib.win-amd64-cpython-38\pyk4a
copying pyk4a\transformation.py -> build\lib.win-amd64-cpython-38\pyk4a
copying pyk4a\win32_utils.py -> build\lib.win-amd64-cpython-38\pyk4a
copying pyk4a\__init__.py -> build\lib.win-amd64-cpython-38\pyk4a
copying pyk4a\py.typed -> build\lib.win-amd64-cpython-38\pyk4a
running build_ext
building 'k4a_module' extension
creating build\temp.win-amd64-cpython-38
creating build\temp.win-amd64-cpython-38\Release
creating build\temp.win-amd64-cpython-38\Release\pyk4a
"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD "-IC:\Program Files\Azure Kinect SDK v1.4.1\sdk\include" -IC:\Users\borguser\AppData\Local\Temp\pip-build-env-gv2mj5pl\overlay\Lib\site-packages\numpy\core\include "-Ic:\program files\python38\include" "-Ic:\program files\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.10240.0\ucrt" /EHsc /Tppyk4a/pyk4a.cpp /Fobuild\temp.win-amd64-cpython-38\Release\pyk4a/pyk4a.obj
pyk4a.cpp
c:\program files\python38\include\pyconfig.h(205): fatal error C1083: Cannot open include file: 'basetsd.h': No such file or directory
C:\Users\borguser\AppData\Local\Temp\pip-build-env-gv2mj5pl\overlay\Lib\site-packages\setuptools\dist.py:788: UserWarning: Usage of dash-separated 'description-file' will not be supported in future versions. Please use the underscore name 'description_file' instead
warnings.warn(
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\x86_amd64\\cl.exe' failed with exit code 2
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for pyk4a
Failed to build pyk4a
ERROR: Could not build wheels for pyk4a, which is required to install pyproject.toml-based projects