I can't install MobSF in Windows 10 because some error when bulid lief. I have install python 3.8 on my laptop.
Error in my installation
**Running setup.py install for lief ... error
ERROR: Command errored out with exit status 1:
command: 'C:\Users\CTI\AppData\Local\Programs\Python\Python38\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\CTI\\AppData\\Local\\Temp\\pip-install-ks8755du\\lief_3404ee98b1ef45c9a9780275fba1c784\\setup.py'"'"'; __file__='"'"'C:\\Users\\CTI\\AppData\\Local\\Temp\\pip-install-ks8755du\\lief_3404ee98b1ef45c9a9780275fba1c784\\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\CTI\AppData\Local\Temp\pip-record-cjp9pgsa\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\CTI\AppData\Local\Programs\Python\Python38\Include\lief'
cwd: C:\Users\CTI\AppData\Local\Temp\pip-install-ks8755du\lief_3404ee98b1ef45c9a9780275fba1c784\
Complete output (87 lines):
0.10.1
running install
running build
running build_ext
cmake C:\Users\CTI\AppData\Local\Temp\pip-install-ks8755du\lief_3404ee98b1ef45c9a9780275fba1c784 -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\CTI\AppData\Local\Temp\pip-install-ks8755du\lief_3404ee98b1ef45c9a9780275fba1c784\build\temp.win-amd64-3.8 -DPYTHON_EXECUTABLE=C:\Users\CTI\AppData\Local\Programs\Python\Python38\python.exe -DLIEF_PYTHON_API=on -DCMAKE_BUILD_TYPE=Release -DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\Users\CTI\AppData\Local\Temp\pip-install-ks8755du\lief_3404ee98b1ef45c9a9780275fba1c784\build\temp.win-amd64-3.8 -DLIEF_USE_CRT_RELEASE=MT -A x64
-- Building for: Visual Studio 16 2019
-- LIEF_CRT: /MT
-- Using Release VC++ CRT: MT
-- Could NOT find cppcheck (missing: CPPCHECK_EXECUTABLE CPPCHECK_POSSIBLEERROR_ARG CPPCHECK_UNUSEDFUNC_ARG CPPCHECK_STYLE_ARG CPPCHECK_INCLUDEPATH_ARG CPPCHECK_QUIET_ARG)
-- The C compiler identification is MSVC 19.28.29335.0
-- The CXX compiler identification is MSVC 19.28.29335.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/BuildTools/VC/Tools/MSVC/14.28.29333/bin/Hostx64/x64/cl.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/BuildTools/VC/Tools/MSVC/14.28.29333/bin/Hostx64/x64/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- LIEF 0.10.0
-- ccache: ON
-- Enable JSON support
-- Enable Frozen (C++14 support)
-- Number of parallel compiler jobs set to /MP
-- Could NOT find cppcheck (missing: CPPCHECK_EXECUTABLE CPPCHECK_POSSIBLEERROR_ARG CPPCHECK_UNUSEDFUNC_ARG CPPCHECK_STYLE_ARG CPPCHECK_INCLUDEPATH_ARG CPPCHECK_QUIET_ARG)
-- Configuration Types: Debug;Release;MinSizeRel;RelWithDebInfo
-- Build Types: Release
-- Found PythonInterp: C:/Users/CTI/AppData/Local/Programs/Python/Python38/python.exe (found suitable version "3.8.7", minimum required is "3.5")
-- Found PythonLibs: C:/Users/CTI/AppData/Local/Programs/Python/Python38/libs/Python38.lib
-- Python version: 3.5
-- Python lib: C:/Users/CTI/AppData/Local/Programs/Python/Python38/libs/Python38.lib
-- Python include: C:/Users/CTI/AppData/Local/Programs/Python/Python38/include
-- Python interpreter: C:/Users/CTI/AppData/Local/Programs/Python/Python38/python.exe
-- Performing Test C_SUPPORTS_NO_MACRO_REDEFINED
-- Performing Test C_SUPPORTS_NO_MACRO_REDEFINED - Failed
-- Performing Test CXX_SUPPORTS_NO_MACRO_REDEFINED
-- Performing Test CXX_SUPPORTS_NO_MACRO_REDEFINED - Failed
-- Performing Test C_SUPPORTS_NO_DEPRECATED_DECLARATIONS
-- Performing Test C_SUPPORTS_NO_DEPRECATED_DECLARATIONS - Failed
-- Performing Test CXX_SUPPORTS_NO_DEPRECATED_DECLARATIONS
-- Performing Test CXX_SUPPORTS_NO_DEPRECATED_DECLARATIONS - Failed
-- Performing Test HAS_ANSI
-- Performing Test HAS_ANSI - Failed
CMake Error at CMakeLists.txt:541 (add_subdirectory):
add_subdirectory given source
"C:/Users/CTI/AppData/Local/Temp/pip-install-ks8755du/lief_3404ee98b1ef45c9a9780275fba1c784/package"
which is not an existing directory.
-- Configuring incomplete, errors occurred!
See also "C:/Users/CTI/AppData/Local/Temp/pip-install-ks8755du/lief_3404ee98b1ef45c9a9780275fba1c784/build/temp.win-amd64-3.8/Release/CMakeFiles/CMakeOutput.log".
See also "C:/Users/CTI/AppData/Local/Temp/pip-install-ks8755du/lief_3404ee98b1ef45c9a9780275fba1c784/build/temp.win-amd64-3.8/Release/CMakeFiles/CMakeError.log".
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\CTI\AppData\Local\Temp\pip-install-ks8755du\lief_3404ee98b1ef45c9a9780275fba1c784\setup.py", line 363, in <module>
setup(
File "C:\Users\CTI\AppData\Roaming\Python\Python38\site-packages\setuptools\__init__.py", line 153, in setup
return distutils.core.setup(**attrs)
File "C:\Users\CTI\AppData\Local\Programs\Python\Python38\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "C:\Users\CTI\AppData\Local\Programs\Python\Python38\lib\distutils\dist.py", line 966, in run_commands
self.run_command(cmd)
File "C:\Users\CTI\AppData\Local\Programs\Python\Python38\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\CTI\AppData\Roaming\Python\Python38\site-packages\setuptools\command\install.py", line 61, in run
return orig.install.run(self)
File "C:\Users\CTI\AppData\Local\Programs\Python\Python38\lib\distutils\command\install.py", line 545, in run
self.run_command('build')
File "C:\Users\CTI\AppData\Local\Programs\Python\Python38\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "C:\Users\CTI\AppData\Local\Programs\Python\Python38\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\CTI\AppData\Local\Programs\Python\Python38\lib\distutils\command\build.py", line 135, in run
self.run_command(cmd_name)
File "C:\Users\CTI\AppData\Local\Programs\Python\Python38\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "C:\Users\CTI\AppData\Local\Programs\Python\Python38\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\CTI\AppData\Local\Temp\pip-install-ks8755du\lief_3404ee98b1ef45c9a9780275fba1c784\setup.py", line 78, in run
self.build_extension(ext)
File "C:\Users\CTI\AppData\Local\Temp\pip-install-ks8755du\lief_3404ee98b1ef45c9a9780275fba1c784\setup.py", line 202, in build_extension
subprocess.check_call(configure_cmd, cwd=self.build_temp, env=env)
File "C:\Users\CTI\AppData\Local\Programs\Python\Python38\lib\subprocess.py", line 364, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', 'C:\\Users\\CTI\\AppData\\Local\\Temp\\pip-install-ks8755du\\lief_3404ee98b1ef45c9a9780275fba1c784', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\\Users\\CTI\\AppData\\Local\\Temp\\pip-install-ks8755du\\lief_3404ee98b1ef45c9a9780275fba1c784\\build\\temp.win-amd64-3.8', '-DPYTHON_EXECUTABLE=C:\\Users\\CTI\\AppData\\Local\\Programs\\Python\\Python38\\python.exe', '-DLIEF_PYTHON_API=on', '-DCMAKE_BUILD_TYPE=Release', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\\Users\\CTI\\AppData\\Local\\Temp\\pip-install-ks8755du\\lief_3404ee98b1ef45c9a9780275fba1c784\\build\\temp.win-amd64-3.8', '-DLIEF_USE_CRT_RELEASE=MT', '-A', 'x64']' returned non-zero exit status 1.
----------------------------------------
ERROR: Command errored out with exit status 1: 'C:\Users\CTI\AppData\Local\Programs\Python\Python38\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\CTI\\AppData\\Local\\Temp\\pip-install-ks8755du\\lief_3404ee98b1ef45c9a9780275fba1c784\\setup.py'"'"'; __file__='"'"'C:\\Users\\CTI\\AppData\\Local\\Temp\\pip-install-ks8755du\\lief_3404ee98b1ef45c9a9780275fba1c784\\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\CTI\AppData\Local\Temp\pip-record-cjp9pgsa\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\CTI\AppData\Local\Programs\Python\Python38\Include\lief' Check the logs for full command output.**
Please help me to fix it.
LIEF won't build on python 3.8 unless you have build dependencies. MobSF on Windows need python 3.7
See this issue raised upstream: https://github.com/lief-project/LIEF/issues/512
Related
I'm trying to install dlib on vertual studio code but the following error is displayed:
Running setup.py install for dlib ... error
ERROR: Command errored out with exit status 1:
command: 'c:\users\acer\appdata\local\programs\python\python39\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\ACER\\AppData\\Local\\Temp\\pip-install-iotpp637\\dlib_cbdb8998ebb54dee8cad48a70a8a0f3c\\setup.py'"'"'; __file__='"'"'C:\\Users\\ACER\\AppData\\Local\\Temp\\pip-install-iotpp637\\dlib_cbdb8998ebb54dee8cad48a70a8a0f3c\\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\ACER\AppData\Local\Temp\pip-record-qzdzy48q\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\acer\appdata\local\programs\python\python39\Include\dlib'
cwd: C:\Users\ACER\AppData\Local\Temp\pip-install-iotpp637\dlib_cbdb8998ebb54dee8cad48a70a8a0f3c\
Complete output (60 lines):
running install
running build
running build_py
package init file 'tools\python\dlib\__init__.py' not found (or not a regular file)
running build_ext
Building extension for Python 3.9.0 (tags/v3.9.0:9cf6752, Oct 5 2020, 15:34:40) [MSC v.1927 64 bit (AMD64)]
Invoking CMake setup: 'cmake C:\Users\ACER\AppData\Local\Temp\pip-install-iotpp637\dlib_cbdb8998ebb54dee8cad48a70a8a0f3c\tools\python -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\ACER\AppData\Local\Temp\pip-install-iotpp637\dlib_cbdb8998ebb54dee8cad48a70a8a0f3c\build\lib.win-amd64-3.9 -DPYTHON_EXECUTABLE=c:\users\acer\appdata\local\programs\python\python39\python.exe -DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\Users\ACER\AppData\Local\Temp\pip-install-iotpp637\dlib_cbdb8998ebb54dee8cad48a70a8a0f3c\build\lib.win-amd64-3.9 -A x64'
-- Building for: NMake Makefiles
CMake Error at CMakeLists.txt:5 (message):
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
You must use Visual Studio to build a python extension on windows. If you
are getting this error it means you have not installed Visual C++. Note
that there are many flavors of Visual Studio, like Visual Studio for C#
development. You need to install Visual Studio for C++.
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-- Configuring incomplete, errors occurred!
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\ACER\AppData\Local\Temp\pip-install-iotpp637\dlib_cbdb8998ebb54dee8cad48a70a8a0f3c\setup.py", line 223, in <module>
setup(
File "c:\users\acer\appdata\local\programs\python\python39\lib\site-packages\setuptools\__init__.py", line 165, in setup
return distutils.core.setup(**attrs)
File "c:\users\acer\appdata\local\programs\python\python39\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "c:\users\acer\appdata\local\programs\python\python39\lib\distutils\dist.py", line 966, in run_commands
self.run_command(cmd)
File "c:\users\acer\appdata\local\programs\python\python39\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "c:\users\acer\appdata\local\programs\python\python39\lib\site-packages\setuptools\command\install.py", line 61, in run
return orig.install.run(self)
File "c:\users\acer\appdata\local\programs\python\python39\lib\distutils\command\install.py", line 546, in run
self.run_command('build')
File "c:\users\acer\appdata\local\programs\python\python39\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "c:\users\acer\appdata\local\programs\python\python39\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "c:\users\acer\appdata\local\programs\python\python39\lib\distutils\command\build.py", line 135, in run
self.run_command(cmd_name)
File "c:\users\acer\appdata\local\programs\python\python39\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "c:\users\acer\appdata\local\programs\python\python39\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\ACER\AppData\Local\Temp\pip-install-iotpp637\dlib_cbdb8998ebb54dee8cad48a70a8a0f3c\setup.py", line 135, in run
self.build_extension(ext)
File "C:\Users\ACER\AppData\Local\Temp\pip-install-iotpp637\dlib_cbdb8998ebb54dee8cad48a70a8a0f3c\setup.py", line 172, in build_extension
subprocess.check_call(cmake_setup, cwd=build_folder)
File "c:\users\acer\appdata\local\programs\python\python39\lib\subprocess.py", line 373, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', 'C:\\Users\\ACER\\AppData\\Local\\Temp\\pip-install-iotpp637\\dlib_cbdb8998ebb54dee8cad48a70a8a0f3c\\tools\\python', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\\Users\\ACER\\AppData\\Local\\Temp\\pip-install-iotpp637\\dlib_cbdb8998ebb54dee8cad48a70a8a0f3c\\build\\lib.win-amd64-3.9', '-DPYTHON_EXECUTABLE=c:\\users\\acer\\appdata\\local\\programs\\python\\python39\\python.exe', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\\Users\\ACER\\AppData\\Local\\Temp\\pip-install-iotpp637\\dlib_cbdb8998ebb54dee8cad48a70a8a0f3c\\build\\lib.win-amd64-3.9', '-A', 'x64']' returned non-zero exit status 1.
----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\users\acer\appdata\local\programs\python\python39\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\ACER\\AppData\\Local\\Temp\\pip-install-iotpp637\\dlib_cbdb8998ebb54dee8cad48a70a8a0f3c\\setup.py'"'"'; __file__='"'"'C:\\Users\\ACER\\AppData\\Local\\Temp\\pip-install-iotpp637\\dlib_cbdb8998ebb54dee8cad48a70a8a0f3c\\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\ACER\AppData\Local\Temp\pip-record-qzdzy48q\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\acer\appdata\local\programs\python\python39\Include\dlib' Check the logs for full command output.
Additional note: I installed cmake and tried again but nothing change.
The error is obvious from the error message you got:
You must use Visual Studio to build a python extension on windows. If
you
are getting this error it means you have not installed Visual C++. Note
that there are many flavors of Visual Studio, like Visual Studio for C#
development. You need to install Visual Studio for C++.
You need to install *Visual Studio for C++ from here and rerun the installation so that the C++ extension to Python can get built.
You can avoid that using Anaconda where the dlib package is available already compiled (but for the moment not for Python 3.9).
you can use the following method to avoid installing the "Huge" IDE (VS) or the Anaconda.
Many binaries depend on Microsoft Visual C++ Redistributable for Visual Studio 2015, 2017 and 2019 for Python 3
so, please try to use the following codes to solve it
pip install --upgrade setuptools
if you are not succeed to solve this problem,
then you can try to use this link The latest supported Visual C++ downloads to install this problem
I've been using the python module apriltag (found here https://pypi.org/project/apriltag/) on linux for a while, and need to move my system over to Windows. On my windows machine, I tried to install the apriltag pip package on python3.6:
python -m pip install apriltag
but the wheel failed to build, giving me a long error list in which I believe the key line is
Building Custom Rule C:/Users/xxxx/apriltag_3b8f424df9f543459d5bd3db09137d9f/core/CMakeLists.txt
cl : Command line error D8021: invalid numeric argument '/Wsign-compare'```
Worried that maybe the PyPI package didn't work on windows(?) I looked at the project that it was based on, found here https://github.com/swatbotics/apriltag. Cloning into it and building it with Visual Studio, the first build fails with
Error D8021 invalid numeric argument '/Wsign-compare'
I've looked on here for /Wsign-compare but have found no example of anyone even getting that error, let alone solving it. Let me know if there's a fix for it, or if this repo just isn't going to build on windows ever.
Thanks :)
EDIT: added entire python build log for context
python -m pip install apriltag
Collecting apriltag
Using cached apriltag-0.0.16.tar.gz (201 kB)
Building wheels for collected packages: apriltag
Building wheel for apriltag (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: 'C:\Users\xxxxxx\AppData\Local\Programs\Python\Python36\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\xxxxxx\\AppData\\Local\\Temp\\2\\pip-install-4bvz6i3j\\apriltag_80d1649893034236a5513184eaa51946\\setup.py'"'"'; __file__='"'"'C:\\Users\\xxxxxx\\AppData\\Local\\Temp\\2\\pip-install-4bvz6i3j\\apriltag_80d1649893034236a5513184eaa51946\\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\xxxxxx\AppData\Local\Temp\2\pip-wheel-b7pu6nq2'
cwd: C:\Users\xxxxxx\AppData\Local\Temp\2\pip-install-4bvz6i3j\apriltag_80d1649893034236a5513184eaa51946\
Complete output (75 lines):
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win-amd64-3.6
copying python\apriltag.py -> build\lib.win-amd64-3.6
running build_ext
-- Building for: Visual Studio 15 2017
-- The C compiler identification is MSVC 19.14.26428.1
-- The CXX compiler identification is MSVC 19.14.26428.1
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Professional/VC/Tools/MSVC/14.14.26428/bin/Hostx86/x64/cl.exe
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Professional/VC/Tools/MSVC/14.14.26428/bin/Hostx86/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/2017/Professional/VC/Tools/MSVC/14.14.26428/bin/Hostx86/x64/cl.exe
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Professional/VC/Tools/MSVC/14.14.26428/bin/Hostx86/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
-- Found PkgConfig: C:/msys64/usr/bin/pkg-config.exe (found version "0.29.2")
-- 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/xxxxxx/AppData/Local/Temp/2/pip-install-4bvz6i3j/apriltag_80d1649893034236a5513184eaa51946/build/temp.win-amd64-3.6/Release
Microsoft (R) Build Engine version 15.7.177.53362 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\VC\VCTargets\Microsoft.CppBuild.targets(399,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\xxxxxx\AppData\Local\Temp\2\pip-install-4bvz6i3j\apriltag_80d1649893034236a5513184eaa51946\build\temp.win-amd64-3.6\Release\ZERO_CHECK.vcxproj]
Checking Build System
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\VC\VCTargets\Microsoft.CppBuild.targets(399,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\xxxxxx\AppData\Local\Temp\2\pip-install-4bvz6i3j\apriltag_80d1649893034236a5513184eaa51946\build\temp.win-amd64-3.6\Release\core\apriltag.vcxproj]
Building Custom Rule C:/Users/xxxxxx/AppData/Local/Temp/2/pip-install-4bvz6i3j/apriltag_80d1649893034236a5513184eaa51946/core/CMakeLists.txt
cl : Command line error D8021: invalid numeric argument '/Wsign-compare' [C:\Users\xxxxxx\AppData\Local\Temp\2\pip-install-4bvz6i3j\apriltag_80d1649893034236a5513184eaa51946\build\temp.win-amd64-3.6\Release\core\apriltag.vcxproj]
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\xxxxxx\AppData\Local\Temp\2\pip-install-4bvz6i3j\apriltag_80d1649893034236a5513184eaa51946\setup.py", line 74, in <module>
py_modules=['apriltag']
File "C:\Users\xxxxxx\AppData\Local\Programs\Python\Python36\lib\site-packages\setuptools\__init__.py", line 153, in setup
return distutils.core.setup(**attrs)
File "C:\Users\xxxxxx\AppData\Local\Programs\Python\Python36\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "C:\Users\xxxxxx\AppData\Local\Programs\Python\Python36\lib\distutils\dist.py", line 955, in run_commands
self.run_command(cmd)
File "C:\Users\xxxxxx\AppData\Local\Programs\Python\Python36\lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "C:\Users\xxxxxx\AppData\Local\Programs\Python\Python36\lib\site-packages\wheel\bdist_wheel.py", line 192, in run
self.run_command('build')
File "C:\Users\xxxxxx\AppData\Local\Programs\Python\Python36\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "C:\Users\xxxxxx\AppData\Local\Programs\Python\Python36\lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "C:\Users\xxxxxx\AppData\Local\Programs\Python\Python36\lib\distutils\command\build.py", line 135, in run
self.run_command(cmd_name)
File "C:\Users\xxxxxx\AppData\Local\Programs\Python\Python36\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "C:\Users\xxxxxx\AppData\Local\Programs\Python\Python36\lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "C:\Users\xxxxxx\AppData\Local\Temp\2\pip-install-4bvz6i3j\apriltag_80d1649893034236a5513184eaa51946\setup.py", line 35, in run
self.build_extension(ext)
File "C:\Users\xxxxxx\AppData\Local\Temp\2\pip-install-4bvz6i3j\apriltag_80d1649893034236a5513184eaa51946\setup.py", line 60, in build_extension
subprocess.check_call(['cmake', '--build', '.'] + build_args, cwd=self.build_temp)
File "C:\Users\xxxxxx\AppData\Local\Programs\Python\Python36\lib\subprocess.py", line 311, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', '--build', '.', '--config', 'Release', '--', '/m']' returned non-zero exit status 1.
----------------------------------------
ERROR: Failed building wheel for apriltag
Running setup.py clean for apriltag
Failed to build apriltag
Installing collected packages: apriltag
Running setup.py install for apriltag ... error
ERROR: Command errored out with exit status 1:
command: 'C:\Users\xxxxxx\AppData\Local\Programs\Python\Python36\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\xxxxxx\\AppData\\Local\\Temp\\2\\pip-install-4bvz6i3j\\apriltag_80d1649893034236a5513184eaa51946\\setup.py'"'"'; __file__='"'"'C:\\Users\\xxxxxx\\AppData\\Local\\Temp\\2\\pip-install-4bvz6i3j\\apriltag_80d1649893034236a5513184eaa51946\\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\xxxxxx\AppData\Local\Temp\2\pip-record-ryn6eco8\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\xxxxxx\AppData\Local\Programs\Python\Python36\Include\apriltag'
cwd: C:\Users\xxxxxx\AppData\Local\Temp\2\pip-install-4bvz6i3j\apriltag_80d1649893034236a5513184eaa51946\
Complete output (77 lines):
running install
running build
running build_py
creating build
creating build\lib.win-amd64-3.6
copying python\apriltag.py -> build\lib.win-amd64-3.6
running build_ext
-- Building for: Visual Studio 15 2017
-- The C compiler identification is MSVC 19.14.26428.1
-- The CXX compiler identification is MSVC 19.14.26428.1
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Professional/VC/Tools/MSVC/14.14.26428/bin/Hostx86/x64/cl.exe
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Professional/VC/Tools/MSVC/14.14.26428/bin/Hostx86/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/2017/Professional/VC/Tools/MSVC/14.14.26428/bin/Hostx86/x64/cl.exe
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Professional/VC/Tools/MSVC/14.14.26428/bin/Hostx86/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
-- Found PkgConfig: C:/msys64/usr/bin/pkg-config.exe (found version "0.29.2")
-- 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/xxxxxx/AppData/Local/Temp/2/pip-install-4bvz6i3j/apriltag_80d1649893034236a5513184eaa51946/build/temp.win-amd64-3.6/Release
Microsoft (R) Build Engine version 15.7.177.53362 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\VC\VCTargets\Microsoft.CppBuild.targets(399,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\xxxxxx\AppData\Local\Temp\2\pip-install-4bvz6i3j\apriltag_80d1649893034236a5513184eaa51946\build\temp.win-amd64-3.6\Release\ZERO_CHECK.vcxproj]
Checking Build System
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\VC\VCTargets\Microsoft.CppBuild.targets(399,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\xxxxxx\AppData\Local\Temp\2\pip-install-4bvz6i3j\apriltag_80d1649893034236a5513184eaa51946\build\temp.win-amd64-3.6\Release\core\apriltag.vcxproj]
Building Custom Rule C:/Users/xxxxxx/AppData/Local/Temp/2/pip-install-4bvz6i3j/apriltag_80d1649893034236a5513184eaa51946/core/CMakeLists.txt
cl : Command line error D8021: invalid numeric argument '/Wsign-compare' [C:\Users\xxxxxx\AppData\Local\Temp\2\pip-install-4bvz6i3j\apriltag_80d1649893034236a5513184eaa51946\build\temp.win-amd64-3.6\Release\core\apriltag.vcxproj]
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\xxxxxx\AppData\Local\Temp\2\pip-install-4bvz6i3j\apriltag_80d1649893034236a5513184eaa51946\setup.py", line 74, in <module>
py_modules=['apriltag']
File "C:\Users\xxxxxx\AppData\Local\Programs\Python\Python36\lib\site-packages\setuptools\__init__.py", line 153, in setup
return distutils.core.setup(**attrs)
File "C:\Users\xxxxxx\AppData\Local\Programs\Python\Python36\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "C:\Users\xxxxxx\AppData\Local\Programs\Python\Python36\lib\distutils\dist.py", line 955, in run_commands
self.run_command(cmd)
File "C:\Users\xxxxxx\AppData\Local\Programs\Python\Python36\lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "C:\Users\xxxxxx\AppData\Local\Programs\Python\Python36\lib\site-packages\setuptools\command\install.py", line 61, in run
return orig.install.run(self)
File "C:\Users\xxxxxx\AppData\Local\Programs\Python\Python36\lib\distutils\command\install.py", line 545, in run
self.run_command('build')
File "C:\Users\xxxxxx\AppData\Local\Programs\Python\Python36\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "C:\Users\xxxxxx\AppData\Local\Programs\Python\Python36\lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "C:\Users\xxxxxx\AppData\Local\Programs\Python\Python36\lib\distutils\command\build.py", line 135, in run
self.run_command(cmd_name)
File "C:\Users\xxxxxx\AppData\Local\Programs\Python\Python36\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "C:\Users\xxxxxx\AppData\Local\Programs\Python\Python36\lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "C:\Users\xxxxxx\AppData\Local\Temp\2\pip-install-4bvz6i3j\apriltag_80d1649893034236a5513184eaa51946\setup.py", line 35, in run
self.build_extension(ext)
File "C:\Users\xxxxxx\AppData\Local\Temp\2\pip-install-4bvz6i3j\apriltag_80d1649893034236a5513184eaa51946\setup.py", line 60, in build_extension
subprocess.check_call(['cmake', '--build', '.'] + build_args, cwd=self.build_temp)
File "C:\Users\xxxxxx\AppData\Local\Programs\Python\Python36\lib\subprocess.py", line 311, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', '--build', '.', '--config', 'Release', '--', '/m']' returned non-zero exit status 1.
----------------------------------------
ERROR: Command errored out with exit status 1: 'C:\Users\xxxxxx\AppData\Local\Programs\Python\Python36\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\xxxxxx\\AppData\\Local\\Temp\\2\\pip-install-4bvz6i3j\\apriltag_80d1649893034236a5513184eaa51946\\setup.py'"'"'; __file__='"'"'C:\\Users\\xxxxxx\\AppData\\Local\\Temp\\2\\pip-install-4bvz6i3j\\apriltag_80d1649893034236a5513184eaa51946\\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\xxxxxx\AppData\Local\Temp\2\pip-record-ryn6eco8\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\xxxxxx\AppData\Local\Programs\Python\Python36\Include\apriltag' Check the logs for full command output.```
I got the same error with that PyPI apriltag library.
Short answer: Don't use this poorly-maintained library. Use pupil-apriltags instead, which will work on Windows as well.
More details
The PyPI package apriltag [https://pypi.org/project/apriltag/#description] we are trying to install, via pip install apriltag is apparently an "unofficial package" by a man named Bernd Winkler, last updated 7 December 2018.
The actual Python wrapper module created by Matt Zucker
[https://github.com/mzucker] and last updated on GitHub 18 July 2018
at https://github.com/swatbotics/apriltag.
FYI, Matt's wrapper is for the C code written by the April Lab at the University of Michigan, headed Edwin Olson, who invented AprilTags in May 2010. [https://github.com/AprilRobotics/apriltag].
Matt says:
"Please note: I am not the maintainer of the pypi package listed at https://pypi.org/project/apriltag/ – GitHub issues filed here reporting problems with that package will be summarily closed. Sorry, I don't have time to support someone else's unofficial package."
So a better installation process would start from what Matt says at his GitHub repo:
cd /path/to/apriltag
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
make -j4
If you want to install the library and important binaries to your system directories, you can then type
sudo make install
Note: The apriltag does not appear to work on Windows:
For me, on Windows, the "make" command was not available, so I followed this:
Install Chocolatey at https://chocolatey.org/install
Run choco install make
Even so, the make command didn't do anything, though.
However, on Windows after running:
import cv2
import apriltag
img = cv2.imread('test.jpg', cv2.IMREAD_GRAYSCALE)
detector = apriltag.Detector()
result = detector.detect(img)
print(result)
Gives the error: AttributeError: module 'os' has no attribute 'uname', which is only available on UNIX.
In searching I found other, better-maintained Python libraries for the AprilTag C bindings. In particular, this one: pupil_apriltags. And it works on Windows.
I am using vs code in windows 10. When I install face_recognition in vs code using pip I got the following error, I have also tried to install dlib before installing face_recognition.
ERROR: Command errored out with exit status 1:
command: 'c:\users\admin\appdata\local\programs\python\python38\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Admin\\AppData\\Local\\Temp\\pip-install-fi__6w9v\\dlib\\setup.py'"'"'; __file__='"'"'C:\\Users\\Admin\\AppData\\Local\\Temp\\pip-install-fi__6w9v\\dlib\\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-f5b3pskr\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\admin\appdata\local\programs\python\python38\Include\dlib'
cwd: C:\Users\Admin\AppData\Local\Temp\pip-install-fi__6w9v\dlib\
Complete output (60 lines):
running install
running build
running build_py
package init file 'tools\python\dlib\__init__.py' not found (or not a regular file)
running build_ext
Building extension for Python 3.8.5 (tags/v3.8.5:580fbb0, Jul 20 2020, 15:57:54) [MSC v.1924 64 bit (AMD64)]
Invoking CMake setup: 'cmake C:\Users\Admin\AppData\Local\Temp\pip-install-fi__6w9v\dlib\tools\python -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\Admin\AppData\Local\Temp\pip-install-fi__6w9v\dlib\build\lib.win-amd64-3.8 -DPYTHON_EXECUTABLE=c:\users\admin\appdata\local\programs\python\python38\python.exe -DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\Users\Admin\AppData\Local\Temp\pip-install-fi__6w9v\dlib\build\lib.win-amd64-3.8 -A x64'
-- Building for: NMake Makefiles
CMake Error at CMakeLists.txt:5 (message):
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
You must use Visual Studio to build a python extension on windows. If you
are getting this error it means you have not installed Visual C++. Note
that there are many flavors of Visual Studio, like Visual Studio for C#
development. You need to install Visual Studio for C++.
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-- Configuring incomplete, errors occurred!
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\Admin\AppData\Local\Temp\pip-install-fi__6w9v\dlib\setup.py", line 223, in <module>
setup(
File "c:\users\admin\appdata\local\programs\python\python38\lib\site-packages\setuptools\__init__.py", line 144, in setup
return distutils.core.setup(**attrs)
File "c:\users\admin\appdata\local\programs\python\python38\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "c:\users\admin\appdata\local\programs\python\python38\lib\distutils\dist.py", line 966, in run_commands
self.run_command(cmd)
File "c:\users\admin\appdata\local\programs\python\python38\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "c:\users\admin\appdata\local\programs\python\python38\lib\site-packages\setuptools\command\install.py", line 61, in run
return orig.install.run(self)
File "c:\users\admin\appdata\local\programs\python\python38\lib\distutils\command\install.py", line 545, in run
self.run_command('build')
File "c:\users\admin\appdata\local\programs\python\python38\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "c:\users\admin\appdata\local\programs\python\python38\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "c:\users\admin\appdata\local\programs\python\python38\lib\distutils\command\build.py", line 135, in run
self.run_command(cmd_name)
File "c:\users\admin\appdata\local\programs\python\python38\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "c:\users\admin\appdata\local\programs\python\python38\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\Admin\AppData\Local\Temp\pip-install-fi__6w9v\dlib\setup.py", line 135, in run
self.build_extension(ext)
File "C:\Users\Admin\AppData\Local\Temp\pip-install-fi__6w9v\dlib\setup.py", line 172, in build_extension
subprocess.check_call(cmake_setup, cwd=build_folder)
File "c:\users\admin\appdata\local\programs\python\python38\lib\subprocess.py", line 364, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', 'C:\\Users\\Admin\\AppData\\Local\\Temp\\pip-install-fi__6w9v\\dlib\\tools\\python', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\\Users\\Admin\\AppData\\Local\\Temp\\pip-install-fi__6w9v\\dlib\\build\\lib.win-amd64-3.8', '-DPYTHON_EXECUTABLE=c:\\users\\admin\\appdata\\local\\programs\\python\\python38\\python.exe', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\\Users\\Admin\\AppData\\Local\\Temp\\pip-install-fi__6w9v\\dlib\\build\\lib.win-amd64-3.8', '-A', 'x64']' returned non-zero exit status 1.
----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\users\admin\appdata\local\programs\python\python38\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Admin\\AppData\\Local\\Temp\\pip-install-fi__6w9v\\dlib\\setup.py'"'"'; __file__='"'"'C:\\Users\\Admin\\AppData\\Local\\Temp\\pip-install-fi__6w9v\\dlib\\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-f5b3pskr\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\admin\appdata\local\programs\python\python38\Include\dlib' Check the logs for full command output.
The answer is really simple. You have to do what it says. Go to the VS installer and install VS for C++ and C#. The reason is that these modules use C code and while using Visual Studio, you have to make it so that it can compile the C++ code
For those who don't want to install the entirety of Visual Studio there is an easier way to get the required CMake tools:
Step 1: Download and run Build Tools for Visual Studio 2022 https://visualstudio.microsoft.com/downloads/#build-tools-for-visual-studio-2019
Step 2: Go to Individual Components and select C++ CMake tools for Windows and run through the install.
Step 3: Proceed to build your python application (e.g. dlib)
I try to install onnx in cmd using the command pip install onnx, but I receive an error which says that I have a problem in cmake.
The error output is:
ERROR: Command errored out with exit status 1:
>>command: 'c:\users\realm\appdata\local\programs\python\python38-32\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\realm\\AppData\\Local\\Temp\\pip-install-oxwi8385\\onnx\\setup.py'"'"'; __file__='"'"'C:\\Users\\realm\\AppData\\Local\\Temp\\pip-install-oxwi8385\\onnx\\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\realm\AppData\Local\Temp\pip-record-h01e7u49\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\realm\appdata\local\programs\python\python38-32\Include\onnx'
cwd: C:\Users\realm\AppData\Local\Temp\pip-install-oxwi8385\onnx\
Complete output (82 lines):
running install
running build
running build_py
running create_version
running cmake_build
-- Building for: NMake Makefiles
-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
CMake Error at CMakeLists.txt:17 (project):
The CMAKE_C_COMPILER:
cl
is not a full path and was not found in the PATH.
To use the NMake generator with Visual C++, cmake must be run from a shell
that can use the compiler cl from the command line. This environment is
unable to invoke the cl compiler. To fix this problem, run cmake from the
Visual Studio Command Prompt (vcvarsall.bat).
Tell CMake where to find the compiler by setting either the environment
variable "CC" or the CMake cache entry CMAKE_C_COMPILER to the full path to
the compiler, or to the compiler name if it is in the PATH.
CMake Error at CMakeLists.txt:17 (project):
The CMAKE_CXX_COMPILER:
cl
is not a full path and was not found in the PATH.
To use the NMake generator with Visual C++, cmake must be run from a shell
that can use the compiler cl from the command line. This environment is
unable to invoke the cl compiler. To fix this problem, run cmake from the
Visual Studio Command Prompt (vcvarsall.bat).
Tell CMake where to find the compiler by setting either the environment
variable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full path
to the compiler, or to the compiler name if it is in the PATH.
>
-- Configuring incomplete, errors occurred!
See also "C:/Users/realm/AppData/Local/Temp/pip-install-oxwi8385/onnx/.setuptools-cmake-build/CMakeFiles/CMakeOutput.log".
See also "C:/Users/realm/AppData/Local/Temp/pip-install-oxwi8385/onnx/.setuptools-cmake-build/CMakeFiles/CMakeError.log".
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\realm\AppData\Local\Temp\pip-install-oxwi8385\onnx\setup.py", line 315, in <module>
setuptools.setup(
File "c:\users\realm\appdata\local\programs\python\python38-32\lib\site-packages\setuptools\__init__.py", line 145, in setup
return distutils.core.setup(**attrs)
File "c:\users\realm\appdata\local\programs\python\python38-32\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "c:\users\realm\appdata\local\programs\python\python38-32\lib\distutils\dist.py", line 966, in run_commands
self.run_command(cmd)
File "c:\users\realm\appdata\local\programs\python\python38-32\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "c:\users\realm\appdata\local\programs\python\python38-32\lib\site-packages\setuptools\command\install.py", line 61, in run
return orig.install.run(self)
File "c:\users\realm\appdata\local\programs\python\python38-32\lib\distutils\command\install.py", line 545, in run
self.run_command('build')
File "c:\users\realm\appdata\local\programs\python\python38-32\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "c:\users\realm\appdata\local\programs\python\python38-32\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "c:\users\realm\appdata\local\programs\python\python38-32\lib\distutils\command\build.py", line 135, in run
self.run_command(cmd_name)
File "c:\users\realm\appdata\local\programs\python\python38-32\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "c:\users\realm\appdata\local\programs\python\python38-32\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\realm\AppData\Local\Temp\pip-install-oxwi8385\onnx\setup.py", line 209, in run
self.run_command('cmake_build')
File "c:\users\realm\appdata\local\programs\python\python38-32\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "c:\users\realm\appdata\local\programs\python\python38-32\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\realm\AppData\Local\Temp\pip-install-oxwi8385\onnx\setup.py", line 195, in run
subprocess.check_call(cmake_args)
File "c:\users\realm\appdata\local\programs\python\python38-32\lib\subprocess.py", line 364, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['C:\\Users\\realm\\AppData\\Local\\Programs\\Python\\Python38-32\\Scripts\\cmake.exe', '-DPYTHON_INCLUDE_DIR=c:\\users\\realm\\appdata\\local\\programs\\python\\python38-32\\include', '-DPYTHON_EXECUTABLE=c:\\users\\realm\\appdata\\local\\programs\\python\\python38-32\\python.exe', '-DBUILD_ONNX_PYTHON=ON', '-DCMAKE_EXPORT_COMPILE_COMMANDS=ON', '-DONNX_NAMESPACE=onnx', '-DPY_EXT_SUFFIX=.cp38-win32.pyd', '-DCMAKE_BUILD_TYPE=Release', '-DPY_VERSION=3.8', '-DONNX_USE_MSVC_STATIC_RUNTIME=ON', '-DONNX_ML=1', 'C:\\Users\\realm\\AppData\\Local\\Temp\\pip-install-oxwi8385\\onnx']' returned non-zero exit status 1.
----------------------------------------
ERROR: Command errored out with exit status 1:
>>'c:\users\realm\appdata\local\programs\python\python38-32\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\realm\\AppData\\Local\\Temp\\pip-install-oxwi8385\\onnx\\setup.py'"'"'; __file__='"'"'C:\\Users\\realm\\AppData\\Local\\Temp\\pip-install-oxwi8385\\onnx\\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\realm\AppData\Local\Temp\pip-record-h01e7u49\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\realm\appdata\local\programs\python\python38-32\Include\onnx' Check the logs for full command output.
I found the solution, the cause was the version of python that I use version 3.8 but when I changed the version to 3.7 it worked I don't know exactly why I found that onnx did not have 3.8 wheel that's why it is not supported by version 3.8
I've seen quite a few old answers, but nothing new. I'm trying to pip install face_recognition which requires the dlib library. I have already tried to pip install cmake and it installed fine. I tried to pip install dlib by itself and got errors. I tried multiple versions and it didn't work. Here's the specific portion of the error I'm trying to resolve. I've watched like 10 YouTube videos and nothing addresses this specific problem.
CMake Error at C:/Users/Notebook/AppData/Local/Temp/pip-install-m4y9pm9i/dlib/dlib/external/pybind11/tools/FindPythonLibsNew.cmake:124 (message):
Python config failure: Python is 32-bit, chosen compiler is 64-bit
And here's the whole error.
ERROR: Command errored out with exit status 1:
command: 'c:\users\notebook\appdata\local\programs\python\python37-32\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Notebook\\AppData\\Local\\Temp\\pip-install-m4y9pm9i\\dlib\\setup.py'"'"'; __file__='"'"'C:\\Users\\Notebook\\AppData\\Local\\Temp\\pip-install-m4y9pm9i\\dlib\\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\Notebook\AppData\Local\Temp\pip-record-zvgo3oos\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\notebook\appdata\local\programs\python\python37-32\Include\dlib'
cwd: C:\Users\Notebook\AppData\Local\Temp\pip-install-m4y9pm9i\dlib\
Complete output (66 lines):
running install
running build
running build_py
package init file 'dlib\__init__.py' not found (or not a regular file)
running build_ext
Building extension for Python 3.7.3 (v3.7.3:ef4ec6ed12, Mar 25 2019, 21:26:53) [MSC v.1916 32 bit (Intel)]
Invoking CMake setup: 'cmake C:\Users\Notebook\AppData\Local\Temp\pip-install-m4y9pm9i\dlib\tools\python -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\Notebook\AppData\Local\Temp\pip-install-m4y9pm9i\dlib\build\lib.win32-3.7 -DPYTHON_EXECUTABLE=c:\users\notebook\appdata\local\programs\python\python37-32\python.exe -DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\Users\Notebook\AppData\Local\Temp\pip-install-m4y9pm9i\dlib\build\lib.win32-3.7'
-- Building for: Visual Studio 16 2019
-- Selecting Windows SDK version 10.0.17763.0 to target Windows 10.0.18363.
-- The C compiler identification is MSVC 19.21.27702.2
-- The CXX compiler identification is MSVC 19.21.27702.2
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/BuildTools/VC/Tools/MSVC/14.21.27702/bin/Hostx64/x64/cl.exe
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/BuildTools/VC/Tools/MSVC/14.21.27702/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/BuildTools/VC/Tools/MSVC/14.21.27702/bin/Hostx64/x64/cl.exe
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/BuildTools/VC/Tools/MSVC/14.21.27702/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
-- Found PythonInterp: C:/Users/Notebook/AppData/Local/Programs/Python/Python37-32/python.exe (found version "3.7.3")
CMake Error at C:/Users/Notebook/AppData/Local/Temp/pip-install-m4y9pm9i/dlib/dlib/external/pybind11/tools/FindPythonLibsNew.cmake:124 (message):
Python config failure: Python is 32-bit, chosen compiler is 64-bit
Call Stack (most recent call first):
C:/Users/Notebook/AppData/Local/Temp/pip-install-m4y9pm9i/dlib/dlib/external/pybind11/tools/pybind11Tools.cmake:16 (find_package)
C:/Users/Notebook/AppData/Local/Temp/pip-install-m4y9pm9i/dlib/dlib/external/pybind11/CMakeLists.txt:33 (include)
-- Configuring incomplete, errors occurred!
See also "C:/Users/Notebook/AppData/Local/Temp/pip-install-m4y9pm9i/dlib/build/temp.win32-3.7/Release/CMakeFiles/CMakeOutput.log".
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\Notebook\AppData\Local\Temp\pip-install-m4y9pm9i\dlib\setup.py", line 261, in <module>
'Topic :: Software Development',
File "c:\users\notebook\appdata\local\programs\python\python37-32\lib\site-packages\setuptools\__init__.py", line 145, in setup
return distutils.core.setup(**attrs)
File "c:\users\notebook\appdata\local\programs\python\python37-32\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "c:\users\notebook\appdata\local\programs\python\python37-32\lib\distutils\dist.py", line 966, in run_commands
self.run_command(cmd)
File "c:\users\notebook\appdata\local\programs\python\python37-32\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "c:\users\notebook\appdata\local\programs\python\python37-32\lib\site-packages\setuptools\command\install.py", line 61, in run
return orig.install.run(self)
File "c:\users\notebook\appdata\local\programs\python\python37-32\lib\distutils\command\install.py", line 545, in run
self.run_command('build')
File "c:\users\notebook\appdata\local\programs\python\python37-32\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "c:\users\notebook\appdata\local\programs\python\python37-32\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "c:\users\notebook\appdata\local\programs\python\python37-32\lib\distutils\command\build.py", line 135, in run
self.run_command(cmd_name)
File "c:\users\notebook\appdata\local\programs\python\python37-32\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "c:\users\notebook\appdata\local\programs\python\python37-32\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\Notebook\AppData\Local\Temp\pip-install-m4y9pm9i\dlib\setup.py", line 135, in run
self.build_extension(ext)
File "C:\Users\Notebook\AppData\Local\Temp\pip-install-m4y9pm9i\dlib\setup.py", line 172, in build_extension
subprocess.check_call(cmake_setup, cwd=build_folder)
File "c:\users\notebook\appdata\local\programs\python\python37-32\lib\subprocess.py", line 347, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', 'C:\\Users\\Notebook\\AppData\\Local\\Temp\\pip-install-m4y9pm9i\\dlib\\tools\\python', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\\Users\\Notebook\\AppData\\Local\\Temp\\pip-install-m4y9pm9i\\dlib\\build\\lib.win32-3.7', '-DPYTHON_EXECUTABLE=c:\\users\\notebook\\appdata\\local\\programs\\python\\python37-32\\python.exe', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\\Users\\Notebook\\AppData\\Local\\Temp\\pip-install-m4y9pm9i\\dlib\\build\\lib.win32-3.7']' returned non-zero exit status 1.
----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\users\notebook\appdata\local\programs\python\python37-32\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Notebook\\AppData\\Local\\Temp\\pip-install-m4y9pm9i\\dlib\\setup.py'"'"'; __file__='"'"'C:\\Users\\Notebook\\AppData\\Local\\Temp\\pip-install-m4y9pm9i\\dlib\\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\Notebook\AppData\Local\Temp\pip-record-zvgo3oos\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\notebook\appdata\local\programs\python\python37-32\Include\dlib' Check the logs for full command output.
I have compiled dlib for android, but did not need to do such for python in windows. Download 64 bit Anaconda Python 3.7, create a conda environment and install dlib on it.
https://anaconda.org/conda-forge/dlib
You may need to install numpy, opencv etc packages beforehand to avoid some errors. You can then pip install face_recognition in that conda environment.
You could also clone the repo and install it from there. Another way is open the whole project in IDE and create a python script to run your code.
https://github.com/ageitgey/face_recognition
https://pypi.org/project/face-recognition/