I am a beginner in the Python programming language. I am Working on a project for facial landmark detection in Python. For this I am trying to use dlib.
I am using PyCharm IDE for Python programming language, but when I am trying to install dlib library on my PyCharm package then I am getting the following error.
Can anyone please help me solving this.
Edit:
Here is the complete error that I am getting.
**Collecting dlib
Using cached https://files.pythonhosted.org/packages/05/57/e8a8caa3c89a27f80bc78da39c423e2553f482a3705adc619176a3a24b36/dlib-19.17.0.tar.gz
Installing collected packages: dlib
Running setup.py install for dlib: started
Running setup.py install for dlib: finished with status 'error'
Complete output from command /Users/mayanktiwari/human_detect/untitled/bin/python -u -c "import setuptools, tokenize;file='/private/var/folders/ww/21lp_4013plfs5g1ym7wh39h0000gn/T/pycharm-packaging/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 /private/var/folders/ww/21lp_4013plfs5g1ym7wh39h0000gn/T/pip-record-hq673j64/install-record.txt --single-version-externally-managed --compile --install-headers /Users/mayanktiwari/human_detect/untitled/include/site/python3.7/dlib:
running install
running build
running build_py
package init file 'dlib/init.py' not found (or not a regular file)
warning: build_py: byte-compiling is disabled, skipping.
running build_ext
Building extension for Python 3.7.2 (default, Dec 27 2018, 07:35:52)
Invoking CMake setup: 'cmake /private/var/folders/ww/21lp_4013plfs5g1ym7wh39h0000gn/T/pycharm-packaging/dlib/tools/python -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/private/var/folders/ww/21lp_4013plfs5g1ym7wh39h0000gn/T/pycharm-packaging/dlib/build/lib.macosx-10.13-x86_64-3.7 -DPYTHON_EXECUTABLE=/Users/mayanktiwari/human_detect/untitled/bin/python -DCMAKE_BUILD_TYPE=Release'
-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- broken
CMake Error at /usr/local/Cellar/cmake/3.13.2/share/cmake/Modules/CMakeTestCCompiler.cmake:52 (message):
The C compiler
"/usr/bin/cc"
is not able to compile a simple test program.
It fails with the following output:
Change Dir: /private/var/folders/ww/21lp_4013plfs5g1ym7wh39h0000gn/T/pycharm-packaging/dlib/build/temp.macosx-10.13-x86_64-3.7/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/make" "cmTC_dc7d9/fast"
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
CMake will not be able to correctly generate this project.
-- Configuring incomplete, errors occurred!
See also "/private/var/folders/ww/21lp_4013plfs5g1ym7wh39h0000gn/T/pycharm-packaging/dlib/build/temp.macosx-10.13-x86_64-3.7/CMakeFiles/CMakeOutput.log".
See also "/private/var/folders/ww/21lp_4013plfs5g1ym7wh39h0000gn/T/pycharm-packaging/dlib/build/temp.macosx-10.13-x86_64-3.7/CMakeFiles/CMakeError.log".
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/ww/21lp_4013plfs5g1ym7wh39h0000gn/T/pycharm-packaging/dlib/setup.py", line 261, in <module>
'Topic :: Software Development',
File "/Users/mayanktiwari/human_detect/untitled/lib/python3.7/site-packages/setuptools-40.8.0-py3.7.egg/setuptools/__init__.py", line 145, in setup
File "/usr/local/Cellar/python/3.7.2/Frameworks/Python.framework/Versions/3.7/lib/python3.7/distutils/core.py", line 148, in setup
dist.run_commands()
File "/usr/local/Cellar/python/3.7.2/Frameworks/Python.framework/Versions/3.7/lib/python3.7/distutils/dist.py", line 966, in run_commands
self.run_command(cmd)
File "/usr/local/Cellar/python/3.7.2/Frameworks/Python.framework/Versions/3.7/lib/python3.7/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "/Users/mayanktiwari/human_detect/untitled/lib/python3.7/site-packages/setuptools-40.8.0-py3.7.egg/setuptools/command/install.py", line 61, in run
File "/usr/local/Cellar/python/3.7.2/Frameworks/Python.framework/Versions/3.7/lib/python3.7/distutils/command/install.py", line 545, in run
self.run_command('build')
File "/usr/local/Cellar/python/3.7.2/Frameworks/Python.framework/Versions/3.7/lib/python3.7/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/usr/local/Cellar/python/3.7.2/Frameworks/Python.framework/Versions/3.7/lib/python3.7/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "/usr/local/Cellar/python/3.7.2/Frameworks/Python.framework/Versions/3.7/lib/python3.7/distutils/command/build.py", line 135, in run
self.run_command(cmd_name)
File "/usr/local/Cellar/python/3.7.2/Frameworks/Python.framework/Versions/3.7/lib/python3.7/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/usr/local/Cellar/python/3.7.2/Frameworks/Python.framework/Versions/3.7/lib/python3.7/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "/private/var/folders/ww/21lp_4013plfs5g1ym7wh39h0000gn/T/pycharm-packaging/dlib/setup.py", line 135, in run
self.build_extension(ext)
File "/private/var/folders/ww/21lp_4013plfs5g1ym7wh39h0000gn/T/pycharm-packaging/dlib/setup.py", line 172, in build_extension
subprocess.check_call(cmake_setup, cwd=build_folder)
File "/usr/local/Cellar/python/3.7.2/Frameworks/Python.framework/Versions/3.7/lib/python3.7/subprocess.py", line 347, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', '/private/var/folders/ww/21lp_4013plfs5g1ym7wh39h0000gn/T/pycharm-packaging/dlib/tools/python', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/private/var/folders/ww/21lp_4013plfs5g1ym7wh39h0000gn/T/pycharm-packaging/dlib/build/lib.macosx-10.13-x86_64-3.7', '-DPYTHON_EXECUTABLE=/Users/mayanktiwari/human_detect/untitled/bin/python', '-DCMAKE_BUILD_TYPE=Release']' returned non-zero exit status 1.
----------------------------------------
Command "/Users/mayanktiwari/human_detect/untitled/bin/python -u -c "import setuptools, tokenize;file='/private/var/folders/ww/21lp_4013plfs5g1ym7wh39h0000gn/T/pycharm-packaging/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 /private/var/folders/ww/21lp_4013plfs5g1ym7wh39h0000gn/T/pip-record-hq673j64/install-record.txt --single-version-externally-managed --compile --install-headers /Users/mayanktiwari/human_detect/untitled/include/site/python3.7/dlib" failed with error code 1 in /private/var/folders/ww/21lp_4013plfs5g1ym7wh39h0000gn/T/pycharm-packaging/dlib/**
conda install cmake
Then
pip install dlib
It works for me.
I have found the answer to this question. We just need to follow simple steps to install dlib in Python.
Install Python
Install Pycharm
Install Anaconda
Open anaconda, create a new enviornment, and then execute the following commands in the same order.
conda update conda
conda update anaconda
conda install cmake
conda install -c conda-forge dlib
Now in this way you can install dlib on anaconda's virtual enviornment. Next you can access this virtual enviornment inside your Pycharm editor.
Related
I am not able to install dlib on my computer. It gives me this error, but no other posts have helped me. I have been searching for a few hours now but to no avail. I am not familiar with the pip command, so this error does not tell me any meaningful information. Can someone who is more experienced please tell me why this is not working? I have already tried reinstalling Microsoft Visual Studio C++ 2015, but that did not work. Installing CMake did not work either. Can someone please help me fix this?
Error:
pip install dlib
Collecting dlib
Using cached dlib-19.22.1.tar.gz (7.4 MB)
Building wheels for collected packages: dlib
Building wheel for dlib (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: 'C:\Users\danie\Desktop\pythonProject\venv\Scripts\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\danie\\AppData
\\Local\\Temp\\pip-install-qaxhyxsu\\dlib_74869802ec0f4350b1acbcfa765926a5\\setup.py'"'"'; __file__='"'"'C:\\Users\\danie\\AppData\\Local\\Temp\\pip-install-qaxhyxsu\\d
lib_74869802ec0f4350b1acbcfa765926a5\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setupto
ols import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d 'C:\Users\
danie\AppData\Local\Temp\pip-wheel-aho58vt2'
cwd: C:\Users\danie\AppData\Local\Temp\pip-install-qaxhyxsu\dlib_74869802ec0f4350b1acbcfa765926a5\
Complete output (58 lines):
running bdist_wheel
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.5 (tags/v3.9.5:0a7dcbd, May 3 2021, 17:27:52) [MSC v.1928 64 bit (AMD64)]
Invoking CMake setup: 'cmake C:\Users\danie\AppData\Local\Temp\pip-install-qaxhyxsu\dlib_74869802ec0f4350b1acbcfa765926a5\tools\python -DCMAKE_LIBRARY_OUTPUT_DIRECTOR
Y=C:\Users\danie\AppData\Local\Temp\pip-install-qaxhyxsu\dlib_74869802ec0f4350b1acbcfa765926a5\build\lib.win-amd64-3.9 -DPYTHON_EXECUTABLE=C:\Users\danie\Desktop\python
Project\venv\Scripts\python.exe -DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\Users\danie\AppData\Local\Temp\pip-install-qaxhyxsu\dlib_74869802ec0f4350b1acbcfa765926a5\bu
ild\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\danie\AppData\Local\Temp\pip-install-qaxhyxsu\dlib_74869802ec0f4350b1acbcfa765926a5\setup.py", line 222, in <module>
setup(
File "C:\Users\danie\Desktop\pythonProject\venv\lib\site-packages\setuptools\__init__.py", line 153, in setup
return distutils.core.setup(**attrs)
File "C:\Users\danie\AppData\Local\Programs\Python\Python39\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "C:\Users\danie\AppData\Local\Programs\Python\Python39\lib\distutils\dist.py", line 966, in run_commands
self.run_command(cmd)
File "C:\Users\danie\AppData\Local\Programs\Python\Python39\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\danie\Desktop\pythonProject\venv\lib\site-packages\wheel\bdist_wheel.py", line 299, in run
self.run_command('build')
File "C:\Users\danie\AppData\Local\Programs\Python\Python39\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "C:\Users\danie\AppData\Local\Programs\Python\Python39\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\danie\AppData\Local\Programs\Python\Python39\lib\distutils\command\build.py", line 135, in run
self.run_command(cmd_name)
File "C:\Users\danie\AppData\Local\Programs\Python\Python39\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "C:\Users\danie\AppData\Local\Programs\Python\Python39\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\danie\AppData\Local\Temp\pip-install-qaxhyxsu\dlib_74869802ec0f4350b1acbcfa765926a5\setup.py", line 134, in run
self.build_extension(ext)
File "C:\Users\danie\AppData\Local\Temp\pip-install-qaxhyxsu\dlib_74869802ec0f4350b1acbcfa765926a5\setup.py", line 171, in build_extension
subprocess.check_call(cmake_setup, cwd=build_folder)
File "C:\Users\danie\AppData\Local\Programs\Python\Python39\lib\subprocess.py", line 373, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', 'C:\\Users\\danie\\AppData\\Local\\Temp\\pip-install-qaxhyxsu\\dlib_74869802ec0f4350b1acbcfa765926a5\\tools\\python'
, '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\\Users\\danie\\AppData\\Local\\Temp\\pip-install-qaxhyxsu\\dlib_74869802ec0f4350b1acbcfa765926a5\\build\\lib.win-amd64-3.9', '-DP
YTHON_EXECUTABLE=C:\\Users\\danie\\Desktop\\pythonProject\\venv\\Scripts\\python.exe', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\\Users\\danie\\AppData\\Local\\Temp\
\pip-install-qaxhyxsu\\dlib_74869802ec0f4350b1acbcfa765926a5\\build\\lib.win-amd64-3.9', '-A', 'x64']' returned non-zero exit status 1.
----------------------------------------
ERROR: Failed building wheel for dlib
Running setup.py clean for dlib
Failed to build dlib
Installing collected packages: dlib
Running setup.py install for dlib ... error
ERROR: Command errored out with exit status 1:
command: 'C:\Users\danie\Desktop\pythonProject\venv\Scripts\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\danie\\AppDa
ta\\Local\\Temp\\pip-install-qaxhyxsu\\dlib_74869802ec0f4350b1acbcfa765926a5\\setup.py'"'"'; __file__='"'"'C:\\Users\\danie\\AppData\\Local\\Temp\\pip-install-qaxhyxsu\
\dlib_74869802ec0f4350b1acbcfa765926a5\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setup
tools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Us
ers\danie\AppData\Local\Temp\pip-record-3n7tervb\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\danie\Desktop\pythonProje
ct\venv\include\site\python3.9\dlib'
cwd: C:\Users\danie\AppData\Local\Temp\pip-install-qaxhyxsu\dlib_74869802ec0f4350b1acbcfa765926a5\
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.5 (tags/v3.9.5:0a7dcbd, May 3 2021, 17:27:52) [MSC v.1928 64 bit (AMD64)]
Invoking CMake setup: 'cmake C:\Users\danie\AppData\Local\Temp\pip-install-qaxhyxsu\dlib_74869802ec0f4350b1acbcfa765926a5\tools\python -DCMAKE_LIBRARY_OUTPUT_DIRECT
ORY=C:\Users\danie\AppData\Local\Temp\pip-install-qaxhyxsu\dlib_74869802ec0f4350b1acbcfa765926a5\build\lib.win-amd64-3.9 -DPYTHON_EXECUTABLE=C:\Users\danie\Desktop\pyth
onProject\venv\Scripts\python.exe -DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\Users\danie\AppData\Local\Temp\pip-install-qaxhyxsu\dlib_74869802ec0f4350b1acbcfa765926a5\
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\danie\AppData\Local\Temp\pip-install-qaxhyxsu\dlib_74869802ec0f4350b1acbcfa765926a5\setup.py", line 222, in <module>
setup(
File "C:\Users\danie\Desktop\pythonProject\venv\lib\site-packages\setuptools\__init__.py", line 153, in setup
return distutils.core.setup(**attrs)
File "C:\Users\danie\AppData\Local\Programs\Python\Python39\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "C:\Users\danie\AppData\Local\Programs\Python\Python39\lib\distutils\dist.py", line 966, in run_commands
self.run_command(cmd)
File "C:\Users\danie\AppData\Local\Programs\Python\Python39\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\danie\Desktop\pythonProject\venv\lib\site-packages\setuptools\command\install.py", line 61, in run
return orig.install.run(self)
File "C:\Users\danie\AppData\Local\Programs\Python\Python39\lib\distutils\command\install.py", line 546, in run
self.run_command('build')
File "C:\Users\danie\AppData\Local\Programs\Python\Python39\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "C:\Users\danie\AppData\Local\Programs\Python\Python39\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\danie\AppData\Local\Programs\Python\Python39\lib\distutils\command\build.py", line 135, in run
self.run_command(cmd_name)
File "C:\Users\danie\AppData\Local\Programs\Python\Python39\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "C:\Users\danie\AppData\Local\Programs\Python\Python39\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\danie\AppData\Local\Temp\pip-install-qaxhyxsu\dlib_74869802ec0f4350b1acbcfa765926a5\setup.py", line 134, in run
self.build_extension(ext)
File "C:\Users\danie\AppData\Local\Temp\pip-install-qaxhyxsu\dlib_74869802ec0f4350b1acbcfa765926a5\setup.py", line 171, in build_extension
subprocess.check_call(cmake_setup, cwd=build_folder)
File "C:\Users\danie\AppData\Local\Programs\Python\Python39\lib\subprocess.py", line 373, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', 'C:\\Users\\danie\\AppData\\Local\\Temp\\pip-install-qaxhyxsu\\dlib_74869802ec0f4350b1acbcfa765926a5\\tools\\pytho
n', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\\Users\\danie\\AppData\\Local\\Temp\\pip-install-qaxhyxsu\\dlib_74869802ec0f4350b1acbcfa765926a5\\build\\lib.win-amd64-3.9', '-
DPYTHON_EXECUTABLE=C:\\Users\\danie\\Desktop\\pythonProject\\venv\\Scripts\\python.exe', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\\Users\\danie\\AppData\\Local\\Tem
p\\pip-install-qaxhyxsu\\dlib_74869802ec0f4350b1acbcfa765926a5\\build\\lib.win-amd64-3.9', '-A', 'x64']' returned non-zero exit status 1.
----------------------------------------
ERROR: Command errored out with exit status 1: 'C:\Users\danie\Desktop\pythonProject\venv\Scripts\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[
0] = '"'"'C:\\Users\\danie\\AppData\\Local\\Temp\\pip-install-qaxhyxsu\\dlib_74869802ec0f4350b1acbcfa765926a5\\setup.py'"'"'; __file__='"'"'C:\\Users\\danie\\AppData\\L
ocal\\Temp\\pip-install-qaxhyxsu\\dlib_74869802ec0f4350b1acbcfa765926a5\\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__, '"'"'exe
c'"'"'))' install --record 'C:\Users\danie\AppData\Local\Temp\pip-record-3n7tervb\install-record.txt' --single-version-externally-managed --compile --install-headers 'C
:\Users\danie\Desktop\pythonProject\venv\include\site\python3.9\dlib' Check the logs for full command output.
WARNING: You are using pip version 21.1.2; however, version 21.3.1 is available.
You should consider upgrading via the 'C:\Users\danie\Desktop\pythonProject\venv\Scripts\python.exe -m pip install --upgrade pip' command.
download cmake executable file on your pc, install it and install cmake build tools for c++ from visual studio build tools. After installing cmake with visual studio build tools, you need to download dlib wheel file from this github repo: https://github.com/Tobyyosoba777/Computer-Vision-OpenCv-Python-/tree/main/Libraries
download: dlib-19.22.99-cp39-cp39-win_amd64.whl
and download: dlib-19.22.99.win-amd64-py3.9.exe
install the .exe file on your pc, restart it(not necessary) and open the current directory of the downloaded .whl file where it is saved on your pc in your python/anaconda terminal/ cmd
for example:
C:\Users\USER->cd desktop "if you downloaded the file to your desktop" this command will move you to the current directory of the .whl file
then input: "pip install dlib-19.22.99-cp39-cp39-win_amd64.whl"
that should work
It worked after I installed all of the visual studio build things (all 80 gb)
Just for anyone coming to this in the future
I have installed Python 3.7.8. in my machine. When I tried to install python face_recognition library I got some errors which telling that need to install cmake and visual c++. Then I installed cmake and visual c++ 2015-2019. But I still get the following errors when I try to install.
Please help me to solve this.
C:\Users\prasa>pip3 install face_recognition
Collecting face_recognition
Using cached face_recognition-1.3.0-py2.py3-none-any.whl (15 kB)
Requirement already satisfied: face-recognition-models>=0.3.0 in c:\users\prasa\appdata\local\programs\python\python37\lib\site-packages (from face_recognition) (0.3.0)
Requirement already satisfied numpy in c:\users\prasa\appdata\local\programs\python\python37\lib\site-packages (from face_recognition) (1.18.5)
Requirement already satisfied: Pillow in c:\users\prasa\appdata\local\programs\python\python37\lib\site-packages (from face_recognition) (7.2.0)
Requirement already satisfied: Click>=6.0 in c:\users\prasa\appdata\local\programs\python\python37\lib\site-packages (from face_recognition) (7.1.2)
Collecting dlib>=19.7
Using cached dlib-19.21.0.tar.gz (3.2 MB)
Building wheels for collected packages: dlib
Building wheel for dlib (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: 'c:\users\prasa\appdata\local\programs\python\python37\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\prasa\\AppData\\Local\\Temp\\pip-install-08cdgdia\\dlib\\setup.py'"'"'; __file__='"'"'C:\\Users\\prasa\\AppData\\Local\\Temp\\pip-install-08cdgdia\\dlib\\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\prasa\AppData\Local\Temp\pip-wheel-y5alb_6d'
cwd: C:\Users\prasa\AppData\Local\Temp\pip-install-08cdgdia\dlib\
Complete output (58 lines):
running bdist_wheel
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.7.8 (tags/v3.7.8:4b47a5b6ba, Jun 28 2020, 08:53:46) [MSC v.1916 64 bit (AMD64)]
Invoking CMake setup: 'cmake C:\Users\prasa\AppData\Local\Temp\pip-install-08cdgdia\dlib\tools\python -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\prasa\AppData\Local\Temp\pip-install-08cdgdia\dlib\build\lib.win-amd64-3.7 -DPYTHON_EXECUTABLE=c:\users\prasa\appdata\local\programs\python\python37\python.exe -DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\Users\prasa\AppData\Local\Temp\pip-install-08cdgdia\dlib\build\lib.win-amd64-3.7 -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\prasa\AppData\Local\Temp\pip-install-08cdgdia\dlib\setup.py", line 262, in <module>
'Topic :: Software Development',
File "c:\users\prasa\appdata\local\programs\python\python37\lib\site-packages\setuptools\__init__.py", line 144, in setup
return distutils.core.setup(**attrs)
File "c:\users\prasa\appdata\local\programs\python\python37\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "c:\users\prasa\appdata\local\programs\python\python37\lib\distutils\dist.py", line 966, in run_commands
self.run_command(cmd)
File "c:\users\prasa\appdata\local\programs\python\python37\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "c:\users\prasa\appdata\local\programs\python\python37\lib\site-packages\wheel\bdist_wheel.py", line 290, in run
self.run_command('build')
File "c:\users\prasa\appdata\local\programs\python\python37\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "c:\users\prasa\appdata\local\programs\python\python37\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "c:\users\prasa\appdata\local\programs\python\python37\lib\distutils\command\build.py", line 135, in run
self.run_command(cmd_name)
File "c:\users\prasa\appdata\local\programs\python\python37\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "c:\users\prasa\appdata\local\programs\python\python37\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\prasa\AppData\Local\Temp\pip-install-08cdgdia\dlib\setup.py", line 135, in run
self.build_extension(ext)
File "C:\Users\prasa\AppData\Local\Temp\pip-install-08cdgdia\dlib\setup.py", line 172, in build_extension
subprocess.check_call(cmake_setup, cwd=build_folder)
File "c:\users\prasa\appdata\local\programs\python\python37\lib\subprocess.py", line 363, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', 'C:\\Users\\prasa\\AppData\\Local\\Temp\\pip-install-08cdgdia\\dlib\\tools\\python', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\\Users\\prasa\\AppData\\Local\\Temp\\pip-install-08cdgdia\\dlib\\build\\lib.win-amd64-3.7', '-DPYTHON_EXECUTABLE=c:\\users\\prasa\\appdata\\local\\programs\\python\\python37\\python.exe', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\\Users\\prasa\\AppData\\Local\\Temp\\pip-install-08cdgdia\\dlib\\build\\lib.win-amd64-3.7', '-A', 'x64']' returned non-zero exit status 1.
----------------------------------------
ERROR: Failed building wheel for dlib
Running setup.py clean for dlib
Failed to build dlib
Installing collected packages: dlib, face-recognition
Running setup.py install for dlib ... error
ERROR: Command errored out with exit status 1:
command: 'c:\users\prasa\appdata\local\programs\python\python37\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\prasa\\AppData\\Local\\Temp\\pip-install-08cdgdia\\dlib\\setup.py'"'"'; __file__='"'"'C:\\Users\\prasa\\AppData\\Local\\Temp\\pip-install-08cdgdia\\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\prasa\AppData\Local\Temp\pip-record-h34wkq_s\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\prasa\appdata\local\programs\python\python37\Include\dlib'
cwd: C:\Users\prasa\AppData\Local\Temp\pip-install-08cdgdia\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.7.8 (tags/v3.7.8:4b47a5b6ba, Jun 28 2020, 08:53:46) [MSC v.1916 64 bit (AMD64)]
Invoking CMake setup: 'cmake C:\Users\prasa\AppData\Local\Temp\pip-install-08cdgdia\dlib\tools\python -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\prasa\AppData\Local\Temp\pip-install-08cdgdia\dlib\build\lib.win-amd64-3.7 -DPYTHON_EXECUTABLE=c:\users\prasa\appdata\local\programs\python\python37\python.exe -DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\Users\prasa\AppData\Local\Temp\pip-install-08cdgdia\dlib\build\lib.win-amd64-3.7 -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\prasa\AppData\Local\Temp\pip-install-08cdgdia\dlib\setup.py", line 262, in <module>
'Topic :: Software Development',
File "c:\users\prasa\appdata\local\programs\python\python37\lib\site-packages\setuptools\__init__.py", line 144, in setup
return distutils.core.setup(**attrs)
File "c:\users\prasa\appdata\local\programs\python\python37\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "c:\users\prasa\appdata\local\programs\python\python37\lib\distutils\dist.py", line 966, in run_commands
self.run_command(cmd)
File "c:\users\prasa\appdata\local\programs\python\python37\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "c:\users\prasa\appdata\local\programs\python\python37\lib\site-packages\setuptools\command\install.py", line 61, in run
return orig.install.run(self)
File "c:\users\prasa\appdata\local\programs\python\python37\lib\distutils\command\install.py", line 545, in run
self.run_command('build')
File "c:\users\prasa\appdata\local\programs\python\python37\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "c:\users\prasa\appdata\local\programs\python\python37\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "c:\users\prasa\appdata\local\programs\python\python37\lib\distutils\command\build.py", line 135, in run
self.run_command(cmd_name)
File "c:\users\prasa\appdata\local\programs\python\python37\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "c:\users\prasa\appdata\local\programs\python\python37\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\prasa\AppData\Local\Temp\pip-install-08cdgdia\dlib\setup.py", line 135, in run
self.build_extension(ext)
File "C:\Users\prasa\AppData\Local\Temp\pip-install-08cdgdia\dlib\setup.py", line 172, in build_extension
subprocess.check_call(cmake_setup, cwd=build_folder)
File "c:\users\prasa\appdata\local\programs\python\python37\lib\subprocess.py", line 363, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', 'C:\\Users\\prasa\\AppData\\Local\\Temp\\pip-install-08cdgdia\\dlib\\tools\\python', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\\Users\\prasa\\AppData\\Local\\Temp\\pip-install-08cdgdia\\dlib\\build\\lib.win-amd64-3.7', '-DPYTHON_EXECUTABLE=c:\\users\\prasa\\appdata\\local\\programs\\python\\python37\\python.exe', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\\Users\\prasa\\AppData\\Local\\Temp\\pip-install-08cdgdia\\dlib\\build\\lib.win-amd64-3.7', '-A', 'x64']' returned non-zero exit status 1.
----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\users\prasa\appdata\local\programs\python\python37\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\prasa\\AppData\\Local\\Temp\\pip-install-08cdgdia\\dlib\\setup.py'"'"'; __file__='"'"'C:\\Users\\prasa\\AppData\\Local\\Temp\\pip-install-08cdgdia\\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\prasa\AppData\Local\Temp\pip-record-h34wkq_s\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\prasa\appdata\local\programs\python\python37\Include\dlib' Check the logs for full command output.
I have already installed VS and CMake but still, I am unable to install dlib.
Following error triggers while executing the command on CMD (pip install dlib) I have tried two versions, dlib and dlib==19.18.0.
I have tried many different solutions but still stuck, also tried to uninstall everything including VS and reinstalling it but this didn't help me.
Microsoft Windows [Version 10.0.18363.900]
(c) 2019 Microsoft Corporation. All rights reserved.
C:\Windows\system32>pip install dlib==19.18.0
Collecting dlib==19.18.0
Using cached dlib-19.18.0.tar.gz (3.1 MB)
Building wheels for collected packages: dlib
Building wheel for dlib (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: 'C:\Users\NOUMAN\anaconda3\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\NOUMAN\\AppData\\Local\\Temp\\pip-install-y57adt7m\\dlib\\setup.py'"'"'; __file__='"'"'C:\\Users\\NOUMAN\\AppData\\Local\\Temp\\pip-install-y57adt7m\\dlib\\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\NOUMAN\AppData\Local\Temp\pip-wheel-5k984utj'
cwd: C:\Users\NOUMAN\AppData\Local\Temp\pip-install-y57adt7m\dlib\
Complete output (84 lines):
running bdist_wheel
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.6 (default, Jan 8 2020, 20:23:39) [MSC v.1916 64 bit (AMD64)]
Invoking CMake setup: 'cmake C:\Users\NOUMAN\AppData\Local\Temp\pip-install-y57adt7m\dlib\tools\python -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\NOUMAN\AppData\Local\Temp\pip-install-y57adt7m\dlib\build\lib.win-amd64-3.7 -DPYTHON_EXECUTABLE=C:\Users\NOUMAN\anaconda3\python.exe -DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\Users\NOUMAN\AppData\Local\Temp\pip-install-y57adt7m\dlib\build\lib.win-amd64-3.7 -A x64'
-- Building for: Visual Studio 16 2019
-- Selecting Windows SDK version 10.0.18362.0 to target Windows 10.0.18363.
CMake Error at CMakeLists.txt:3 (project):
Failed to run MSBuild command:
C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/MSBuild/Current/Bin/MSBuild.exe
to get the value of VCTargetsPath:
Microsoft (R) Build Engine version 16.6.0+5ff7b0c9e for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.
Build started 22/07/2020 10:00:29 am.
Project "C:\Users\NOUMAN\AppData\Local\Temp\pip-install-y57adt7m\dlib\build\temp.win-amd64-3.7\Release\CMakeFiles\3.17.2\VCTargetsPath.vcxproj" on node 1 (default targets).
PrepareForBuild:
Creating directory "x64\Debug\".
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppBuild.targets(475,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\NOUMAN\AppData\Local\Temp\pip-install-y57adt7m\dlib\build\temp.win-amd64-3.7\Release\CMakeFiles\3.17.2\VCTargetsPath.vcxproj]
Creating directory "x64\Debug\VCTargetsPath.tlog\".
InitializeBuildStatus:
Creating "x64\Debug\VCTargetsPath.tlog\unsuccessfulbuild" because "AlwaysCreate" was specified.
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(149,5): error MSB6004: The specified task executable location "C:\Windows\system32\cmd.exe" is invalid. [C:\Users\NOUMAN\AppData\Local\Temp\pip-install-y57adt7m\dlib\build\temp.win-amd64-3.7\Release\CMakeFiles\3.17.2\VCTargetsPath.vcxproj]
Done Building Project "C:\Users\NOUMAN\AppData\Local\Temp\pip-install-y57adt7m\dlib\build\temp.win-amd64-3.7\Release\CMakeFiles\3.17.2\VCTargetsPath.vcxproj" (default targets) -- FAILED.
Build FAILED.
"C:\Users\NOUMAN\AppData\Local\Temp\pip-install-y57adt7m\dlib\build\temp.win-amd64-3.7\Release\CMakeFiles\3.17.2\VCTargetsPath.vcxproj" (default target) (1) ->
(PrepareForBuild target) ->
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppBuild.targets(475,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\NOUMAN\AppData\Local\Temp\pip-install-y57adt7m\dlib\build\temp.win-amd64-3.7\Release\CMakeFiles\3.17.2\VCTargetsPath.vcxproj]
"C:\Users\NOUMAN\AppData\Local\Temp\pip-install-y57adt7m\dlib\build\temp.win-amd64-3.7\Release\CMakeFiles\3.17.2\VCTargetsPath.vcxproj" (default target) (1) ->
(PostBuildEvent target) ->
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(149,5): error MSB6004: The specified task executable location "C:\Windows\system32\cmd.exe" is invalid. [C:\Users\NOUMAN\AppData\Local\Temp\pip-install-y57adt7m\dlib\build\temp.win-amd64-3.7\Release\CMakeFiles\3.17.2\VCTargetsPath.vcxproj]
1 Warning(s)
1 Error(s)
Time Elapsed 00:00:00.65
Exit code: 1
-- Configuring incomplete, errors occurred!
See also "C:/Users/NOUMAN/AppData/Local/Temp/pip-install-y57adt7m/dlib/build/temp.win-amd64-3.7/Release/CMakeFiles/CMakeOutput.log".
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\NOUMAN\AppData\Local\Temp\pip-install-y57adt7m\dlib\setup.py", line 261, in <module>
'Topic :: Software Development',
File "C:\Users\NOUMAN\anaconda3\lib\site-packages\setuptools\__init__.py", line 165, in setup
return distutils.core.setup(**attrs)
File "C:\Users\NOUMAN\anaconda3\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "C:\Users\NOUMAN\anaconda3\lib\distutils\dist.py", line 966, in run_commands
self.run_command(cmd)
File "C:\Users\NOUMAN\anaconda3\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\NOUMAN\anaconda3\lib\site-packages\wheel\bdist_wheel.py", line 223, in run
self.run_command('build')
File "C:\Users\NOUMAN\anaconda3\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "C:\Users\NOUMAN\anaconda3\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\NOUMAN\anaconda3\lib\distutils\command\build.py", line 135, in run
self.run_command(cmd_name)
File "C:\Users\NOUMAN\anaconda3\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "C:\Users\NOUMAN\anaconda3\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\NOUMAN\AppData\Local\Temp\pip-install-y57adt7m\dlib\setup.py", line 135, in run
self.build_extension(ext)
File "C:\Users\NOUMAN\AppData\Local\Temp\pip-install-y57adt7m\dlib\setup.py", line 172, in build_extension
subprocess.check_call(cmake_setup, cwd=build_folder)
File "C:\Users\NOUMAN\anaconda3\lib\subprocess.py", line 363, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', 'C:\\Users\\NOUMAN\\AppData\\Local\\Temp\\pip-install-y57adt7m\\dlib\\tools\\python', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\\Users\\NOUMAN\\AppData\\Local\\Temp\\pip-install-y57adt7m\\dlib\\build\\lib.win-amd64-3.7', '-DPYTHON_EXECUTABLE=C:\\Users\\NOUMAN\\anaconda3\\python.exe', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\\Users\\NOUMAN\\AppData\\Local\\Temp\\pip-install-y57adt7m\\dlib\\build\\lib.win-amd64-3.7', '-A', 'x64']' returned non-zero exit status 1.
----------------------------------------
ERROR: Failed building wheel for dlib
Running setup.py clean for dlib
Failed to build dlib
Installing collected packages: dlib
Running setup.py install for dlib ... error
ERROR: Command errored out with exit status 1:
command: 'C:\Users\NOUMAN\anaconda3\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\NOUMAN\\AppData\\Local\\Temp\\pip-install-y57adt7m\\dlib\\setup.py'"'"'; __file__='"'"'C:\\Users\\NOUMAN\\AppData\\Local\\Temp\\pip-install-y57adt7m\\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\NOUMAN\AppData\Local\Temp\pip-record-fa__5h9h\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\NOUMAN\anaconda3\Include\dlib'
cwd: C:\Users\NOUMAN\AppData\Local\Temp\pip-install-y57adt7m\dlib\
Complete output (86 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.6 (default, Jan 8 2020, 20:23:39) [MSC v.1916 64 bit (AMD64)]
Invoking CMake setup: 'cmake C:\Users\NOUMAN\AppData\Local\Temp\pip-install-y57adt7m\dlib\tools\python -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\NOUMAN\AppData\Local\Temp\pip-install-y57adt7m\dlib\build\lib.win-amd64-3.7 -DPYTHON_EXECUTABLE=C:\Users\NOUMAN\anaconda3\python.exe -DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\Users\NOUMAN\AppData\Local\Temp\pip-install-y57adt7m\dlib\build\lib.win-amd64-3.7 -A x64'
-- Building for: Visual Studio 16 2019
-- Selecting Windows SDK version 10.0.18362.0 to target Windows 10.0.18363.
CMake Error at CMakeLists.txt:3 (project):
Failed to run MSBuild command:
C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/MSBuild/Current/Bin/MSBuild.exe
to get the value of VCTargetsPath:
Microsoft (R) Build Engine version 16.6.0+5ff7b0c9e for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.
Build started 22/07/2020 10:00:33 am.
Project "C:\Users\NOUMAN\AppData\Local\Temp\pip-install-y57adt7m\dlib\build\temp.win-amd64-3.7\Release\CMakeFiles\3.17.2\VCTargetsPath.vcxproj" on node 1 (default targets).
PrepareForBuild:
Creating directory "x64\Debug\".
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppBuild.targets(475,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\NOUMAN\AppData\Local\Temp\pip-install-y57adt7m\dlib\build\temp.win-amd64-3.7\Release\CMakeFiles\3.17.2\VCTargetsPath.vcxproj]
Creating directory "x64\Debug\VCTargetsPath.tlog\".
InitializeBuildStatus:
Creating "x64\Debug\VCTargetsPath.tlog\unsuccessfulbuild" because "AlwaysCreate" was specified.
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(149,5): error MSB6004: The specified task executable location "C:\Windows\system32\cmd.exe" is invalid. [C:\Users\NOUMAN\AppData\Local\Temp\pip-install-y57adt7m\dlib\build\temp.win-amd64-3.7\Release\CMakeFiles\3.17.2\VCTargetsPath.vcxproj]
Done Building Project "C:\Users\NOUMAN\AppData\Local\Temp\pip-install-y57adt7m\dlib\build\temp.win-amd64-3.7\Release\CMakeFiles\3.17.2\VCTargetsPath.vcxproj" (default targets) -- FAILED.
Build FAILED.
"C:\Users\NOUMAN\AppData\Local\Temp\pip-install-y57adt7m\dlib\build\temp.win-amd64-3.7\Release\CMakeFiles\3.17.2\VCTargetsPath.vcxproj" (default target) (1) ->
(PrepareForBuild target) ->
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppBuild.targets(475,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\NOUMAN\AppData\Local\Temp\pip-install-y57adt7m\dlib\build\temp.win-amd64-3.7\Release\CMakeFiles\3.17.2\VCTargetsPath.vcxproj]
"C:\Users\NOUMAN\AppData\Local\Temp\pip-install-y57adt7m\dlib\build\temp.win-amd64-3.7\Release\CMakeFiles\3.17.2\VCTargetsPath.vcxproj" (default target) (1) ->
(PostBuildEvent target) ->
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(149,5): error MSB6004: The specified task executable location "C:\Windows\system32\cmd.exe" is invalid. [C:\Users\NOUMAN\AppData\Local\Temp\pip-install-y57adt7m\dlib\build\temp.win-amd64-3.7\Release\CMakeFiles\3.17.2\VCTargetsPath.vcxproj]
1 Warning(s)
1 Error(s)
Time Elapsed 00:00:00.65
Exit code: 1
-- Configuring incomplete, errors occurred!
See also "C:/Users/NOUMAN/AppData/Local/Temp/pip-install-y57adt7m/dlib/build/temp.win-amd64-3.7/Release/CMakeFiles/CMakeOutput.log".
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\NOUMAN\AppData\Local\Temp\pip-install-y57adt7m\dlib\setup.py", line 261, in <module>
'Topic :: Software Development',
File "C:\Users\NOUMAN\anaconda3\lib\site-packages\setuptools\__init__.py", line 165, in setup
return distutils.core.setup(**attrs)
File "C:\Users\NOUMAN\anaconda3\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "C:\Users\NOUMAN\anaconda3\lib\distutils\dist.py", line 966, in run_commands
self.run_command(cmd)
File "C:\Users\NOUMAN\anaconda3\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\NOUMAN\anaconda3\lib\site-packages\setuptools\command\install.py", line 61, in run
return orig.install.run(self)
File "C:\Users\NOUMAN\anaconda3\lib\distutils\command\install.py", line 545, in run
self.run_command('build')
File "C:\Users\NOUMAN\anaconda3\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "C:\Users\NOUMAN\anaconda3\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\NOUMAN\anaconda3\lib\distutils\command\build.py", line 135, in run
self.run_command(cmd_name)
File "C:\Users\NOUMAN\anaconda3\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "C:\Users\NOUMAN\anaconda3\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\NOUMAN\AppData\Local\Temp\pip-install-y57adt7m\dlib\setup.py", line 135, in run
self.build_extension(ext)
File "C:\Users\NOUMAN\AppData\Local\Temp\pip-install-y57adt7m\dlib\setup.py", line 172, in build_extension
subprocess.check_call(cmake_setup, cwd=build_folder)
File "C:\Users\NOUMAN\anaconda3\lib\subprocess.py", line 363, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', 'C:\\Users\\NOUMAN\\AppData\\Local\\Temp\\pip-install-y57adt7m\\dlib\\tools\\python', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\\Users\\NOUMAN\\AppData\\Local\\Temp\\pip-install-y57adt7m\\dlib\\build\\lib.win-amd64-3.7', '-DPYTHON_EXECUTABLE=C:\\Users\\NOUMAN\\anaconda3\\python.exe', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\\Users\\NOUMAN\\AppData\\Local\\Temp\\pip-install-y57adt7m\\dlib\\build\\lib.win-amd64-3.7', '-A', 'x64']' returned non-zero exit status 1.
----------------------------------------
ERROR: Command errored out with exit status 1: 'C:\Users\NOUMAN\anaconda3\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\NOUMAN\\AppData\\Local\\Temp\\pip-install-y57adt7m\\dlib\\setup.py'"'"'; __file__='"'"'C:\\Users\\NOUMAN\\AppData\\Local\\Temp\\pip-install-y57adt7m\\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\NOUMAN\AppData\Local\Temp\pip-record-fa__5h9h\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\NOUMAN\anaconda3\Include\dlib' Check the logs for full command output.
I cant install dlib on python with cmd , I have downloaded cmake and putted it on PATH, or is there any plugin i have to download it first ? Or does my pip's environment is located at a wrong place ? Or do I have to change my python to 64 bit instead of 32 bit ? If I have to do so , please let me know the way to do it , I am a newbie
C:\Users\Yusuf>python -m pip install dlib --user
Collecting dlib
Using cached https://files.pythonhosted.org/packages/63/92/05c3b98636661cb80d190a5a777dd94effcc14c0f6893222e5ca81e74fbc/dlib-19.19.0.tar.gz
Installing collected packages: dlib
Running setup.py install for dlib ... error
ERROR: Command errored out with exit status 1:
command: 'C:\Program Files (x86)\Python38-32\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Yusuf\\AppData\\Local\\Temp\\pip-install-lpo7_ajq\\dlib\\setup.py'"'"'; __file__='"'"'C:\\Users\\Yusuf\\AppData\\Local\\Temp\\pip-install-lpo7_ajq\\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\Yusuf\AppData\Local\Temp\pip-record-0h0t6gan\install-record.txt' --single-version-externally-managed --compile --user --prefix=
cwd: C:\Users\Yusuf\AppData\Local\Temp\pip-install-lpo7_ajq\dlib\
Complete output (65 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.8.0 (tags/v3.8.0:fa919fd, Oct 14 2019, 19:21:23) [MSC v.1916 32 bit (Intel)]
Invoking CMake setup: 'cmake C:\Users\Yusuf\AppData\Local\Temp\pip-install-lpo7_ajq\dlib\tools\python -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\Yusuf\AppData\Local\Temp\pip-install-lpo7_ajq\dlib\build\lib.win32-3.8 -DPYTHON_EXECUTABLE=C:\Program Files (x86)\Python38-32\python.exe -DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\Users\Yusuf\AppData\Local\Temp\pip-install-lpo7_ajq\dlib\build\lib.win32-3.8'
-- Building for: Visual Studio 16 2019
-- The C compiler identification is MSVC 19.24.28314.0
-- The CXX compiler identification is MSVC 19.24.28314.0
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/BuildTools/VC/Tools/MSVC/14.24.28314/bin/Hostx64/x64/cl.exe
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/BuildTools/VC/Tools/MSVC/14.24.28314/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.24.28314/bin/Hostx64/x64/cl.exe
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/BuildTools/VC/Tools/MSVC/14.24.28314/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:/Program Files (x86)/Python38-32/python.exe (found version "3.8")
CMake Error at C:/Users/Yusuf/AppData/Local/Temp/pip-install-lpo7_ajq/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/Yusuf/AppData/Local/Temp/pip-install-lpo7_ajq/dlib/dlib/external/pybind11/tools/pybind11Tools.cmake:16 (find_package)
C:/Users/Yusuf/AppData/Local/Temp/pip-install-lpo7_ajq/dlib/dlib/external/pybind11/CMakeLists.txt:33 (include)
-- Configuring incomplete, errors occurred!
See also "C:/Users/Yusuf/AppData/Local/Temp/pip-install-lpo7_ajq/dlib/build/temp.win32-3.8/Release/CMakeFiles/CMakeOutput.log".
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\Yusuf\AppData\Local\Temp\pip-install-lpo7_ajq\dlib\setup.py", line 223, in <module>
setup(
File "C:\Program Files (x86)\Python38-32\lib\site-packages\setuptools\__init__.py", line 145, in setup
return distutils.core.setup(**attrs)
File "C:\Program Files (x86)\Python38-32\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "C:\Program Files (x86)\Python38-32\lib\distutils\dist.py", line 966, in run_commands
self.run_command(cmd)
File "C:\Program Files (x86)\Python38-32\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Program Files (x86)\Python38-32\lib\site-packages\setuptools\command\install.py", line 61, in run
return orig.install.run(self)
File "C:\Program Files (x86)\Python38-32\lib\distutils\command\install.py", line 545, in run
self.run_command('build')
File "C:\Program Files (x86)\Python38-32\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "C:\Program Files (x86)\Python38-32\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Program Files (x86)\Python38-32\lib\distutils\command\build.py", line 135, in run
self.run_command(cmd_name)
File "C:\Program Files (x86)\Python38-32\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "C:\Program Files (x86)\Python38-32\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\Yusuf\AppData\Local\Temp\pip-install-lpo7_ajq\dlib\setup.py", line 135, in run
self.build_extension(ext)
File "C:\Users\Yusuf\AppData\Local\Temp\pip-install-lpo7_ajq\dlib\setup.py", line 172, in build_extension
subprocess.check_call(cmake_setup, cwd=build_folder)
File "C:\Program Files (x86)\Python38-32\lib\subprocess.py", line 364, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', 'C:\\Users\\Yusuf\\AppData\\Local\\Temp\\pip-install-lpo7_ajq\\dlib\\tools\\python', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\\Users\\Yusuf\\AppData\\Local\\Temp\\pip-install-lpo7_ajq\\dlib\\build\\lib.win32-3.8', '-DPYTHON_EXECUTABLE=C:\\Program Files (x86)\\Python38-32\\python.exe', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\\Users\\Yusuf\\AppData\\Local\\Temp\\pip-install-lpo7_ajq\\dlib\\build\\lib.win32-3.8']' returned non-zero exit status 1.
----------------------------------------
ERROR: Command errored out with exit status 1: 'C:\Program Files (x86)\Python38-32\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Yusuf\\AppData\\Local\\Temp\\pip-install-lpo7_ajq\\dlib\\setup.py'"'"'; __file__='"'"'C:\\Users\\Yusuf\\AppData\\Local\\Temp\\pip-install-lpo7_ajq\\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\Yusuf\AppData\Local\Temp\pip-record-0h0t6gan\install-record.txt' --single-version-externally-managed --compile --user --prefix= Check the logs for full command output.
Please help me thank you !
NOTE:First make sure you have installed c++ compilers and cmake Then start following the sptes:
go to dlib on github
click on clone or download button and then download the package manually by clicking on the zip download And after the download finished , extract the file and put it in desktop
3.Then open Powershell or cmd
4.type in the command cd C:/users/(your username)/Desktop/master-dlib/master-dlib
5.Then when you changed your current working directory then type in the command python setup.py install
NOTE2: This is the manual way but also look into This Too.
go to python.org copy link location of latest binary executable or binary specific to your python version .
in cmd prompt typepython -m pip install +paste link location.
now run your .py file having dlib .
I have a big problem with dlib installation every time I try pip install dlib it gives me this huge error. I tried downloading packages upgrading system visual studio 2019 or c++ for cmake.
My operating system is Windows 7 64bit and I use Python 3.7.
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
C:\Users\>pip install dlib
Collecting dlib
Using cached https://files.pythonhosted.org/packages/05/57/e8a8caa3c89a27f80bc
78da39c423e2553f482a3705adc619176a3a24b36/dlib-19.17.0.tar.gz
Installing collected packages: dlib
Running setup.py install for dlib ... error
ERROR: Command errored out with exit status 1:
command: 'c:\users\\appdata\local\programs\python\python37-32\python.e
xe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\
\\AppData\\Local\\Temp\\pip-install-8scxhav9\\dlib\\setup.py'"'"'; __file__='"'"
'C:\\Users\\\\AppData\\Local\\Temp\\pip-install-8scxhav9\\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\\AppData\Local\Temp\pip-record-hqcpwy4g\inst
all-record.txt' --single-version-externally-managed --compile
cwd: C:\Users\\AppData\Local\Temp\pip-install-8scxhav9\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.1 (v3.7.1:260ec2c36a, Oct 20 2018, 14:05:1
6) [MSC v.1915 32 bit (Intel)]
Invoking CMake setup: 'cmake C:\Users\\AppData\Local\Temp\pip-install-8
scxhav9\dlib\tools\python -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\\AppDat
a\Local\Temp\pip-install-8scxhav9\dlib\build\lib.win32-3.7 -DPYTHON_EXECUTABLE=c
:\users\\appdata\local\programs\python\python37-32\python.exe -DCMAKE_LIBRA
RY_OUTPUT_DIRECTORY_RELEASE=C:\Users\\AppData\Local\Temp\pip-install-8scxha
v9\dlib\build\lib.win32-3.7'
-- Building for: Visual Studio 16 2019
-- Selecting Windows SDK version 10.0.18362.0 to target Windows 6.1.7601.
-- The C compiler identification is MSVC 19.22.27905.0
-- The CXX compiler identification is MSVC 19.22.27905.0
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Stu
dio/2019/Community/VC/Tools/MSVC/14.22.27905/bin/Hostx64/x64/cl.exe
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Stu
dio/2019/Community/VC/Tools/MSVC/14.22.27905/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 S
tudio/2019/Community/VC/Tools/MSVC/14.22.27905/bin/Hostx64/x64/cl.exe
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual S
tudio/2019/Community/VC/Tools/MSVC/14.22.27905/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//AppData/Local/Programs/Python/Python37
-32/python.exe (found version "3.7.1")
CMake Error at C:/Users//AppData/Local/Temp/pip-install-8scxhav9/dlib/d
lib/external/pybind11/tools/FindPythonLibsNew.cmake:122 (message):
Python config failure: Python is 32-bit, chosen compiler is 64-bit
Call Stack (most recent call first):
C:/Users//AppData/Local/Temp/pip-install-8scxhav9/dlib/dlib/external/
pybind11/tools/pybind11Tools.cmake:16 (find_package)
C:/Users//AppData/Local/Temp/pip-install-8scxhav9/dlib/dlib/external/
pybind11/CMakeLists.txt:33 (include)
-- Configuring incomplete, errors occurred!
See also "C:/Users//AppData/Local/Temp/pip-install-8scxhav9/dlib/build/
temp.win32-3.7/Release/CMakeFiles/CMakeOutput.log".
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\\AppData\Local\Temp\pip-install-8scxhav9\dlib\setup.py
", line 261, in <module>
'Topic :: Software Development',
File "c:\users\\appdata\local\programs\python\python37-32\lib\site-pa
ckages\setuptools\__init__.py", line 143, in setup
return distutils.core.setup(**attrs)
File "c:\users\\appdata\local\programs\python\python37-32\lib\distuti
ls\core.py", line 148, in setup
dist.run_commands()
File "c:\users\\appdata\local\programs\python\python37-32\lib\distuti
ls\dist.py", line 966, in run_commands
self.run_command(cmd)
File "c:\users\\appdata\local\programs\python\python37-32\lib\distuti
ls\dist.py", line 985, in run_command
cmd_obj.run()
File "c:\users\\appdata\local\programs\python\python37-32\lib\site-pa
ckages\setuptools\command\install.py", line 61, in run
return orig.install.run(self)
File "c:\users\\appdata\local\programs\python\python37-32\lib\distuti
ls\command\install.py", line 545, in run
self.run_command('build')
File "c:\users\\appdata\local\programs\python\python37-32\lib\distuti
ls\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "c:\users\\appdata\local\programs\python\python37-32\lib\distuti
ls\dist.py", line 985, in run_command
cmd_obj.run()
File "c:\users\\appdata\local\programs\python\python37-32\lib\distuti
ls\command\build.py", line 135, in run
self.run_command(cmd_name)
File "c:\users\\appdata\local\programs\python\python37-32\lib\distuti
ls\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "c:\users\\appdata\local\programs\python\python37-32\lib\distuti
ls\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\\AppData\Local\Temp\pip-install-8scxhav9\dlib\setup.py
", line 135, in run
self.build_extension(ext)
File "C:\Users\\AppData\Local\Temp\pip-install-8scxhav9\dlib\setup.py
", line 172, in build_extension
subprocess.check_call(cmake_setup, cwd=build_folder)
File "c:\users\\appdata\local\programs\python\python37-32\lib\subproc
ess.py", line 341, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', 'C:\\Users\\\\AppData
\\Local\\Temp\\pip-install-8scxhav9\\dlib\\tools\\python', '-DCMAKE_LIBRARY_OUTP
UT_DIRECTORY=C:\\Users\\\\AppData\\Local\\Temp\\pip-install-8scxhav9\\dlib\
\build\\lib.win32-3.7', '-DPYTHON_EXECUTABLE=c:\\users\\\\appdata\\local\\p
rograms\\python\\python37-32\\python.exe', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_REL
EASE=C:\\Users\\\\AppData\\Local\\Temp\\pip-install-8scxhav9\\dlib\\build\\
lib.win32-3.7']' returned non-zero exit status 1.
----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\users\\appdata\local\pro
grams\python\python37-32\python.exe' -u -c 'import sys, setuptools, tokenize; sy
s.argv[0] = '"'"'C:\\Users\\\\AppData\\Local\\Temp\\pip-install-8scxhav9\\d
lib\\setup.py'"'"'; __file__='"'"'C:\\Users\\\\AppData\\Local\\Temp\\pip-in
stall-8scxhav9\\dlib\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__
file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compi
le(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\\AppData\Lo
cal\Temp\pip-record-hqcpwy4g\install-record.txt' --single-version-externally-man
aged --compile Check the logs for full command output.
If you are already installed Anaconda, Try this
conda install -c conda-forge dlib
Since dlib in conda-forge is the latest one. I hope this solution can help you solve the problem. :)