I'm trying to install Apriltag with Python, and it keeps giving me an error during the build stage.
I'm on Windows 10, and the python wrapper for OpenCV 2 works for me.
Installing collected packages: apriltag
Running setup.py install for apriltag ... error
ERROR: Command errored out with exit status 1:
command: 'C:\Users\legoc\Desktop\Augmented Reality\env\Scripts\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\legoc\\AppData\\Local\\Temp\\pip-install-0vcggsia\\apriltag_da105f092a3b4ae28f7e4c4a3c0e00fa\\setup.py'"'"'; __file__='"'"'C:\\Users\\legoc\\AppData\\Local\\Temp\\pip-install-0vcggsia\\apriltag_da105f092a3b4ae28f7e4c4a3c0e00fa\\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\legoc\AppData\Local\Temp\pip-record-cyusenbz\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\legoc\Desktop\Augmented Reality\env\include\site\python3.8\apriltag'
cwd: C:\Users\legoc\AppData\Local\Temp\pip-install-0vcggsia\apriltag_da105f092a3b4ae28f7e4c4a3c0e00fa\
Complete output (78 lines):
running install
running build
running build_py
creating build
creating build\lib.win-amd64-3.8
copying python\apriltag.py -> build\lib.win-amd64-3.8
running build_ext
-- Building for: Visual Studio 16 2019
-- Selecting Windows SDK version 10.0.18362.0 to target Windows 10.0.19041.
-- The C compiler identification is MSVC 19.27.29112.0
-- The CXX compiler identification is MSVC 19.27.29112.0
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.27.29110/bin/Hostx64/x64/cl.exe
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.27.29110/bin/Hostx64/x64/cl.exe - works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.27.29110/bin/Hostx64/x64/cl.exe
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.27.29110/bin/Hostx64/x64/cl.exe - works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for pthread.h
-- Looking for pthread.h - not found
-- Found Threads: TRUE
-- Could NOT find PkgConfig (missing: PKG_CONFIG_EXECUTABLE)
-- Checking for one of the modules 'opencv>=2.3;opencv-2.3.1;opencv-3.0.0'
-- Configuring done
-- Generating done
CMake Warning:
Manually-specified variables were not used by the project:
PYTHON_EXECUTABLE
-- Build files have been written to: C:/Users/legoc/AppData/Local/Temp/pip-install-0vcggsia/apriltag_da105f092a3b4ae28f7e4c4a3c0e00fa/build/temp.win-amd64-3.8/Release
Microsoft (R) Build Engine version 16.7.0+b89cb5fde for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppBuild.targets(499,5): warning MSB8029: The Intermediate directory or Output directory cannot reside under the Temporary directory as it could lead to issues with incremental build. [C:\Users\legoc\AppData\Local\Temp\pip-install-0vcggsia\apriltag_da105f092a3b4ae28f7e4c4a3c0e00fa\build\temp.win-amd64-3.8\Release\ZERO_CHECK.vcxproj]
Checking Build System
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppBuild.targets(499,5): warning MSB8029: The Intermediate directory or Output directory cannot reside under the Temporary directory as it could lead to issues with incremental build. [C:\Users\legoc\AppData\Local\Temp\pip-install-0vcggsia\apriltag_da105f092a3b4ae28f7e4c4a3c0e00fa\build\temp.win-amd64-3.8\Release\core\apriltag.vcxproj]
Building Custom Rule C:/Users/legoc/AppData/Local/Temp/pip-install-0vcggsia/apriltag_da105f092a3b4ae28f7e4c4a3c0e00fa/core/CMakeLists.txt
cl : command line error D8021: invalid numeric argument '/Wsign-compare' [C:\Users\legoc\AppData\Local\Temp\pip-install-0vcggsia\apriltag_da105f092a3b4ae28f7e4c4a3c0e00fa\build\temp.win-amd64-3.8\Release\core\apriltag.vcxproj]
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\legoc\AppData\Local\Temp\pip-install-0vcggsia\apriltag_da105f092a3b4ae28f7e4c4a3c0e00fa\setup.py", line 62, in <module>
setup(
File "C:\Users\legoc\Desktop\Augmented Reality\env\lib\site-packages\setuptools\__init__.py", line 145, in setup
return distutils.core.setup(**attrs)
File "C:\Program Files\Python38\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "C:\Program Files\Python38\lib\distutils\dist.py", line 966, in run_commands
self.run_command(cmd)
File "C:\Program Files\Python38\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\legoc\Desktop\Augmented Reality\env\lib\site-packages\setuptools\command\install.py", line 61, in run
return orig.install.run(self)
File "C:\Program Files\Python38\lib\distutils\command\install.py", line 545, in run
self.run_command('build')
File "C:\Program Files\Python38\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "C:\Program Files\Python38\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Program Files\Python38\lib\distutils\command\build.py", line 135, in run
self.run_command(cmd_name)
File "C:\Program Files\Python38\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "C:\Program Files\Python38\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\legoc\AppData\Local\Temp\pip-install-0vcggsia\apriltag_da105f092a3b4ae28f7e4c4a3c0e00fa\setup.py", line 35, in run
self.build_extension(ext)
File "C:\Users\legoc\AppData\Local\Temp\pip-install-0vcggsia\apriltag_da105f092a3b4ae28f7e4c4a3c0e00fa\setup.py", line 60, in build_extension
subprocess.check_call(['cmake', '--build', '.'] + build_args, cwd=self.build_temp)
File "C:\Program Files\Python38\lib\subprocess.py", line 364, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', '--build', '.', '--config', 'Release', '--', '/m']' returned non-zero exit status 1.
----------------------------------------```
I'm trying to install Apriltag with Python, and it keeps giving me an error during the build stage.
I'm on Windows 10, and the python wrapper for OpenCV 2 works for me.
Does anyone know how I could fix this?
Other people have had this problem too.
Here's the whole error log: