I tried a lot to install pip install dlib but it always shows an error and I reinstalled cmake.
I got the error:
pip install dlib
Collecting dlib
Using cached https://files.pythonhosted.org/packages/1e/62/aacb236d21fbd08148b1d517d58a9d80ea31bdcd386d26f21f8b23b1eb28/dlib-19.18.0.tar.gz
Building wheels for collected packages: dlib
Building wheel for dlib (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: 'c:\program files\python37\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\hp\\AppData\\Local\\Temp\\pip-install-yynf7mue\\dlib\\setup.py'"'"'; __file__='"'"'C:\\Users\\hp\\AppData\\Local\\Temp\\pip-install-yynf7mue\\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\hp\AppData\Local\Temp\pip-wheel-0eyy_3vd' --python-tag cp37
cwd: C:\Users\hp\AppData\Local\Temp\pip-install-yynf7mue\dlib\
Complete output (55 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.4 (tags/v3.7.4:e09359112e, Jul 8 2019, 20:34:20) [MSC v.1916 64 bit (AMD64)]
Invoking CMake setup: 'cmake C:\Users\hp\AppData\Local\Temp\pip-install-yynf7mue\dlib\tools\python -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\hp\AppData\Local\Temp\pip-install-yynf7mue\dlib\build\lib.win-amd64-3.7 -DPYTHON_EXECUTABLE=c:\program files\python37\python.exe -DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\Users\hp\AppData\Local\Temp\pip-install-yynf7mue\dlib\build\lib.win-amd64-3.7 -A x64'
-- Building for: NMake Makefiles
CMake Error at CMakeLists.txt:3 (project):
Generator
NMake Makefiles
does not support platform specification, but platform
x64
was specified.
CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!
See also "C:/Users/hp/AppData/Local/Temp/pip-install-yynf7mue/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\hp\AppData\Local\Temp\pip-install-yynf7mue\dlib\setup.py", line 261, in <module>
'Topic :: Software Development',
File "c:\program files\python37\lib\site-packages\setuptools\__init__.py", line 145, in setup
return distutils.core.setup(**attrs)
File "c:\program files\python37\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "c:\program files\python37\lib\distutils\dist.py", line 966, in run_commands
self.run_command(cmd)
File "c:\program files\python37\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "c:\program files\python37\lib\site-packages\wheel\bdist_wheel.py", line 192, in run
self.run_command('build')
File "c:\program files\python37\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "c:\program files\python37\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "c:\program files\python37\lib\distutils\command\build.py", line 135, in run
self.run_command(cmd_name)
File "c:\program files\python37\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "c:\program files\python37\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\hp\AppData\Local\Temp\pip-install-yynf7mue\dlib\setup.py", line 135, in run
self.build_extension(ext)
File "C:\Users\hp\AppData\Local\Temp\pip-install-yynf7mue\dlib\setup.py", line 172, in build_extension
subprocess.check_call(cmake_setup, cwd=build_folder)
File "c:\program files\python37\lib\subprocess.py", line 347, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', 'C:\\Users\\hp\\AppData\\Local\\Temp\\pip-install-yynf7mue\\dlib\\tools\\python', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\\Users\\hp\\AppData\\Local\\Temp\\pip-install-yynf7mue\\dlib\\build\\lib.win-amd64-3.7', '-DPYTHON_EXECUTABLE=c:\\program files\\python37\\python.exe', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\\Users\\hp\\AppData\\Local\\Temp\\pip-install-yynf7mue\\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:\program files\python37\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\hp\\AppData\\Local\\Temp\\pip-install-yynf7mue\\dlib\\setup.py'"'"'; __file__='"'"'C:\\Users\\hp\\AppData\\Local\\Temp\\pip-install-yynf7mue\\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\hp\AppData\Local\Temp\pip-record-qzmuuf53\install-record.txt' --single-version-externally-managed --compile
cwd: C:\Users\hp\AppData\Local\Temp\pip-install-yynf7mue\dlib\
Complete output (57 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.4 (tags/v3.7.4:e09359112e, Jul 8 2019, 20:34:20) [MSC v.1916 64 bit (AMD64)]
Invoking CMake setup: 'cmake C:\Users\hp\AppData\Local\Temp\pip-install-yynf7mue\dlib\tools\python -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\hp\AppData\Local\Temp\pip-install-yynf7mue\dlib\build\lib.win-amd64-3.7 -DPYTHON_EXECUTABLE=c:\program files\python37\python.exe -DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\Users\hp\AppData\Local\Temp\pip-install-yynf7mue\dlib\build\lib.win-amd64-3.7 -A x64'
-- Building for: NMake Makefiles
CMake Error at CMakeLists.txt:3 (project):
Generator
NMake Makefiles
does not support platform specification, but platform
x64
was specified.
CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!
See also "C:/Users/hp/AppData/Local/Temp/pip-install-yynf7mue/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\hp\AppData\Local\Temp\pip-install-yynf7mue\dlib\setup.py", line 261, in <module>
'Topic :: Software Development',
File "c:\program files\python37\lib\site-packages\setuptools\__init__.py", line 145, in setup
return distutils.core.setup(**attrs)
File "c:\program files\python37\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "c:\program files\python37\lib\distutils\dist.py", line 966, in run_commands
self.run_command(cmd)
File "c:\program files\python37\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "c:\program files\python37\lib\site-packages\setuptools\command\install.py", line 61, in run
return orig.install.run(self)
File "c:\program files\python37\lib\distutils\command\install.py", line 545, in run
self.run_command('build')
File "c:\program files\python37\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "c:\program files\python37\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "c:\program files\python37\lib\distutils\command\build.py", line 135, in run
self.run_command(cmd_name)
File "c:\program files\python37\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "c:\program files\python37\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\hp\AppData\Local\Temp\pip-install-yynf7mue\dlib\setup.py", line 135, in run
self.build_extension(ext)
File "C:\Users\hp\AppData\Local\Temp\pip-install-yynf7mue\dlib\setup.py", line 172, in build_extension
subprocess.check_call(cmake_setup, cwd=build_folder)
File "c:\program files\python37\lib\subprocess.py", line 347, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', 'C:\\Users\\hp\\AppData\\Local\\Temp\\pip-install-yynf7mue\\dlib\\tools\\python', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\\Users\\hp\\AppData\\Local\\Temp\\pip-install-yynf7mue\\dlib\\build\\lib.win-amd64-3.7', '-DPYTHON_EXECUTABLE=c:\\program files\\python37\\python.exe', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\\Users\\hp\\AppData\\Local\\Temp\\pip-install-yynf7mue\\dlib\\build\\lib.win-amd64-3.7', '-A', 'x64']' returned non-zero exit status 1.
----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\program files\python37\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\hp\\AppData\\Local\\Temp\\pip-install-yynf7mue\\dlib\\setup.py'"'"'; __file__='"'"'C:\\Users\\hp\\AppData\\Local\\Temp\\pip-install-yynf7mue\\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\hp\AppData\Local\Temp\pip-record-qzmuuf53\install-record.txt' --single-version-externally-managed --compile Check the logs for full command output.
Do the following:
1.go to github repository of dlib package
2.click on the the green button which has written clone or download
3.Then click on Download Zip
4.after the download finished , extract the zip file and save it in desktop
NOTE: First intall CMake and then start following other steps.
5.go to dlib-master/dlib-master and copy the directory of dlib-master folder
which for you should be C:\Users\(you'r username)\Desktop\dlib-master\dlib-master, if you followed the steps.
6.Then open pwershell and type cd C:\Users\(you'r username)\Desktop\dlib-master\dlib-master
NOTE: IF you have not installed CMake properly , consider installing it , so that you can install the dlib module without any problem.
7.When you changed your current working directory by typing the above command, Then type python setup.py install
8.If you have installed cmake, then the package would install easily and flawlessly.
Answer Updated
further reading: How to manually install a pypi module without pip/easy_install?
Here I got the error that line
CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
set CMake path into environment variable (As Shown in Figure)
Installing Visual Studio build tool latest version
link: https://visualstudio.microsoft.com/downloads/#build-tools-for-visual-studio-2017
after installing the Visual studio build tool select the package which needed and download it.
after download & installing successfully visual studio install dlib by commanding in CMD(ADMINISTRATOR) pip install dlib
I executed setup.py as #Moh Vahedi said and got following error in cmd:
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++.
So I'm installing VS now :)
This issue is also written here: Error in installing face_recognition module using pip
Related
C:\Users\User_01>pip install dlib
Defaulting to user installation because normal site-packages is not writeable
Collecting dlib
Using cached dlib-19.21.1.tar.gz (3.6 MB)
Building wheels for collected packages: dlib
Building wheel for dlib (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: 'c:\program files\python38\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\User_01\\AppData\\Local\\Temp\\pip-install-trf2srgw\\dlib_042210a71f3f4d22994c8640d6338561\\setup.py'"'"'; __file__='"'"'C:\\Users\\User_01\\AppData\\Local\\Temp\\pip-install-trf2srgw\\dlib_042210a71f3f4d22994c8640d6338561\\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\User_01\AppData\Local\Temp\pip-wheel-u114ylxx'
cwd: C:\Users\User_01\AppData\Local\Temp\pip-install-trf2srgw\dlib_042210a71f3f4d22994c8640d6338561\
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.8.8 (tags/v3.8.8:024d805, Feb 19 2021, 13:18:16) [MSC v.1928 64 bit (AMD64)]
Invoking CMake setup: 'cmake C:\Users\User_01\AppData\Local\Temp\pip-install-trf2srgw\dlib_042210a71f3f4d22994c8640d6338561\tools\python -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\User_01\AppData\Local\Temp\pip-install-trf2srgw\dlib_042210a71f3f4d22994c8640d6338561\build\lib.win-amd64-3.8 -DPYTHON_EXECUTABLE=c:\program files\python38\python.exe -DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\Users\User_01\AppData\Local\Temp\pip-install-trf2srgw\dlib_042210a71f3f4d22994c8640d6338561\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\User_01\AppData\Local\Temp\pip-install-trf2srgw\dlib_042210a71f3f4d22994c8640d6338561\setup.py", line 223, in <module>
setup(
File "c:\program files\python38\lib\site-packages\setuptools\__init__.py", line 165, in setup
return distutils.core.setup(**attrs)
File "c:\program files\python38\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "c:\program files\python38\lib\distutils\dist.py", line 966, in run_commands
self.run_command(cmd)
File "c:\program files\python38\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\User_01\AppData\Roaming\Python\Python38\site-packages\wheel\bdist_wheel.py", line 299, in run
self.run_command('build')
File "c:\program files\python38\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "c:\program files\python38\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "c:\program files\python38\lib\distutils\command\build.py", line 135, in run
self.run_command(cmd_name)
File "c:\program files\python38\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "c:\program files\python38\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\User_01\AppData\Local\Temp\pip-install-trf2srgw\dlib_042210a71f3f4d22994c8640d6338561\setup.py", line 135, in run
self.build_extension(ext)
File "C:\Users\User_01\AppData\Local\Temp\pip-install-trf2srgw\dlib_042210a71f3f4d22994c8640d6338561\setup.py", line 172, in build_extension
subprocess.check_call(cmake_setup, cwd=build_folder)
File "c:\program files\python38\lib\subprocess.py", line 364, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', 'C:\\Users\\User_01\\AppData\\Local\\Temp\\pip-install-trf2srgw\\dlib_042210a71f3f4d22994c8640d6338561\\tools\\python', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\\Users\\User_01\\AppData\\Local\\Temp\\pip-install-trf2srgw\\dlib_042210a71f3f4d22994c8640d6338561\\build\\lib.win-amd64-3.8', '-DPYTHON_EXECUTABLE=c:\\program files\\python38\\python.exe', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\\Users\\User_01\\AppData\\Local\\Temp\\pip-install-trf2srgw\\dlib_042210a71f3f4d22994c8640d6338561\\build\\lib.win-amd64-3.8', '-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:\program files\python38\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\User_01\\AppData\\Local\\Temp\\pip-install-trf2srgw\\dlib_042210a71f3f4d22994c8640d6338561\\setup.py'"'"'; __file__='"'"'C:\\Users\\User_01\\AppData\\Local\\Temp\\pip-install-trf2srgw\\dlib_042210a71f3f4d22994c8640d6338561\\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\User_01\AppData\Local\Temp\pip-record-7k2ytc23\install-record.txt' --single-version-externally-managed --user --prefix= --compile --install-headers 'C:\Users\User_01\AppData\Roaming\Python\Python38\Include\dlib'
cwd: C:\Users\User_01\AppData\Local\Temp\pip-install-trf2srgw\dlib_042210a71f3f4d22994c8640d6338561\
I get this error when trying to install dlib with pip pip install dlib.
This error says
------------------------------------------------------------------------------
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++.
------------------------------------------------------------------------------
I found an answer Download and install visual studios c++ build tools and it will work.
Then run pip on console pip install dlib
download visual studio build tools - https://visualstudio.microsoft.com/thank-you-downloading-visual-studio/?sku=Community&rel=16
C:\WINDOWS\system32>pip install face-recognition
Collecting face-recognition
Using cached face_recognition-1.3.0-py2.py3-none-any.whl (15 kB)
Requirement already satisfied: numpy in c:\users\dell\appdata\local\programs\python\python38-32\lib\site-packages (from face-recognition) (1.19.1)
Requirement already satisfied: face-recognition-models>=0.3.0 in c:\users\dell\appdata\local\programs\python\python38-32\lib\site-packages (from face-recognition) (0.3.0)
Requirement already satisfied: Pillow in c:\users\dell\appdata\local\programs\python\python38-32\lib\site-packages (from face-recognition) (7.2.0)
Collecting dlib>=19.7
Using cached dlib-19.21.0.tar.gz (3.2 MB)
Requirement already satisfied: Click>=6.0 in c:\users\dell\appdata\local\programs\python\python38-32\lib\site-packages (from face-recognition) (7.1.2)
Building wheels for collected packages: dlib
Building wheel for dlib (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: 'c:\users\dell\appdata\local\programs\python\python38-32\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\DELL\\AppData\\Local\\Temp\\pip-install-ffmft1wf\\dlib\\setup.py'"'"'; __file__='"'"'C:\\Users\\DELL\\AppData\\Local\\Temp\\pip-install-ffmft1wf\\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\DELL\AppData\Local\Temp\pip-wheel-xf9e0i7s'
cwd: C:\Users\DELL\AppData\Local\Temp\pip-install-ffmft1wf\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.8.5 (tags/v3.8.5:580fbb0, Jul 20 2020, 15:43:08) [MSC v.1926 32 bit (Intel)]
Invoking CMake setup: 'cmake C:\Users\DELL\AppData\Local\Temp\pip-install-ffmft1wf\dlib\tools\python -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\DELL\AppData\Local\Temp\pip-install-ffmft1wf\dlib\build\lib.win32-3.8 -DPYTHON_EXECUTABLE=c:\users\dell\appdata\local\programs\python\python38-32\python.exe -DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\Users\DELL\AppData\Local\Temp\pip-install-ffmft1wf\dlib\build\lib.win32-3.8'
-- 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\DELL\AppData\Local\Temp\pip-install-ffmft1wf\dlib\setup.py", line 223, in <module>
setup(
File "c:\users\dell\appdata\local\programs\python\python38-32\lib\site-packages\setuptools\__init__.py", line 153, in setup
return distutils.core.setup(**attrs)
File "c:\users\dell\appdata\local\programs\python\python38-32\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "c:\users\dell\appdata\local\programs\python\python38-32\lib\distutils\dist.py", line 966, in run_commands
self.run_command(cmd)
File "c:\users\dell\appdata\local\programs\python\python38-32\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "c:\users\dell\appdata\local\programs\python\python38-32\lib\site-packages\wheel\bdist_wheel.py", line 290, in run
self.run_command('build')
File "c:\users\dell\appdata\local\programs\python\python38-32\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "c:\users\dell\appdata\local\programs\python\python38-32\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "c:\users\dell\appdata\local\programs\python\python38-32\lib\distutils\command\build.py", line 135, in run
self.run_command(cmd_name)
File "c:\users\dell\appdata\local\programs\python\python38-32\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "c:\users\dell\appdata\local\programs\python\python38-32\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\DELL\AppData\Local\Temp\pip-install-ffmft1wf\dlib\setup.py", line 135, in run
self.build_extension(ext)
File "C:\Users\DELL\AppData\Local\Temp\pip-install-ffmft1wf\dlib\setup.py", line 172, in build_extension
subprocess.check_call(cmake_setup, cwd=build_folder)
File "c:\users\dell\appdata\local\programs\python\python38-32\lib\subprocess.py", line 364, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', 'C:\\Users\\DELL\\AppData\\Local\\Temp\\pip-install-ffmft1wf\\dlib\\tools\\python', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\\Users\\DELL\\AppData\\Local\\Temp\\pip-install-ffmft1wf\\dlib\\build\\lib.win32-3.8', '-DPYTHON_EXECUTABLE=c:\\users\\dell\\appdata\\local\\programs\\python\\python38-32\\python.exe', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\\Users\\DELL\\AppData\\Local\\Temp\\pip-install-ffmft1wf\\dlib\\build\\lib.win32-3.8']' 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\dell\appdata\local\programs\python\python38-32\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\DELL\\AppData\\Local\\Temp\\pip-install-ffmft1wf\\dlib\\setup.py'"'"'; __file__='"'"'C:\\Users\\DELL\\AppData\\Local\\Temp\\pip-install-ffmft1wf\\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\DELL\AppData\Local\Temp\pip-record-k_fgj9zq\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\dell\appdata\local\programs\python\python38-32\Include\dlib'
cwd: C:\Users\DELL\AppData\Local\Temp\pip-install-ffmft1wf\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:43:08) [MSC v.1926 32 bit (Intel)]
Invoking CMake setup: 'cmake C:\Users\DELL\AppData\Local\Temp\pip-install-ffmft1wf\dlib\tools\python -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\DELL\AppData\Local\Temp\pip-install-ffmft1wf\dlib\build\lib.win32-3.8 -DPYTHON_EXECUTABLE=c:\users\dell\appdata\local\programs\python\python38-32\python.exe -DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\Users\DELL\AppData\Local\Temp\pip-install-ffmft1wf\dlib\build\lib.win32-3.8'
-- 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\DELL\AppData\Local\Temp\pip-install-ffmft1wf\dlib\setup.py", line 223, in <module>
setup(
File "c:\users\dell\appdata\local\programs\python\python38-32\lib\site-packages\setuptools\__init__.py", line 153, in setup
return distutils.core.setup(**attrs)
File "c:\users\dell\appdata\local\programs\python\python38-32\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "c:\users\dell\appdata\local\programs\python\python38-32\lib\distutils\dist.py", line 966, in run_commands
self.run_command(cmd)
File "c:\users\dell\appdata\local\programs\python\python38-32\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "c:\users\dell\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\dell\appdata\local\programs\python\python38-32\lib\distutils\command\install.py", line 545, in run
self.run_command('build')
File "c:\users\dell\appdata\local\programs\python\python38-32\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "c:\users\dell\appdata\local\programs\python\python38-32\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "c:\users\dell\appdata\local\programs\python\python38-32\lib\distutils\command\build.py", line 135, in run
self.run_command(cmd_name)
File "c:\users\dell\appdata\local\programs\python\python38-32\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "c:\users\dell\appdata\local\programs\python\python38-32\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\DELL\AppData\Local\Temp\pip-install-ffmft1wf\dlib\setup.py", line 135, in run
self.build_extension(ext)
File "C:\Users\DELL\AppData\Local\Temp\pip-install-ffmft1wf\dlib\setup.py", line 172, in build_extension
subprocess.check_call(cmake_setup, cwd=build_folder)
File "c:\users\dell\appdata\local\programs\python\python38-32\lib\subprocess.py", line 364, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', 'C:\\Users\\DELL\\AppData\\Local\\Temp\\pip-install-ffmft1wf\\dlib\\tools\\python', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\\Users\\DELL\\AppData\\Local\\Temp\\pip-install-ffmft1wf\\dlib\\build\\lib.win32-3.8', '-DPYTHON_EXECUTABLE=c:\\users\\dell\\appdata\\local\\programs\\python\\python38-32\\python.exe', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\\Users\\DELL\\AppData\\Local\\Temp\\pip-install-ffmft1wf\\dlib\\build\\lib.win32-3.8']' returned non-zero exit status 1.
----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\users\dell\appdata\local\programs\python\python38-32\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\DELL\\AppData\\Local\\Temp\\pip-install-ffmft1wf\\dlib\\setup.py'"'"'; __file__='"'"'C:\\Users\\DELL\\AppData\\Local\\Temp\\pip-install-ffmft1wf\\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\DELL\AppData\Local\Temp\pip-record-k_fgj9zq\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\dell\appdata\local\programs\python\python38-32\Include\dlib' Check the logs for full command output.
Have you try this steps? Face-recognition on windows
Officially this package is not supporting windows but this steps might be help you.
Also the another way is you can download it's environment with virtual box on windows system. From here pre-configured VM
I guess it will help you. Thank you
Why don't you adopt deepface? It is more lightweight and it covers Keras based facial recognition models. In other words, it is easier to install and run.
#!pip install deepface
from deepface import DeepFace
models = ["VGG-Face", "Facenet", "OpenFace", "DeepFace", "DeepID"]
res = DeepFace.verify("img1.jpg", "img2.jpg", model_name = models[0])
I have been trying to download dlib on my system from past one week and I am not able to download it using pip or the manual process I also have looked on several questions asked here and checked the required processes like.
but still, I was unsuccessful ... I need to learn about opencv and dlib so please help me anyone ... and my device properties which I think might not be the problem.
Installed C and C++ compilers and add them to a path.
Installed visual studio 2015 (VS2015) down-loader and 2017 both
Installed all the dependencies through VS2015.(support for C, C++, MS Build, Windows SDK, etc)
C:\Users\Akshay>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: Complete output from command 'c:\users\akshay\appdata\local\programs\
python\python37\python.exe' -u -c 'import setuptools, tokenize;__file__='"'"'C:\
\Users\\Akshay\\AppData\\Local\\Temp\\pip-install-8qdv7218\\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\Akshay\AppData\Local\Temp\pip-record-dupqe8e6\instal
l-record.txt' --single-version-externally-managed --compile:
ERROR: 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, 22:22:0
5) [MSC v.1916 64 bit (AMD64)]
Invoking CMake setup: 'cmake C:\Users\Akshay\AppData\Local\Temp\pip-install-
8qdv7218\dlib\tools\python -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\Akshay\AppD
ata\Local\Temp\pip-install-8qdv7218\dlib\build\lib.win-amd64-3.7 -DPYTHON_EXECUT
ABLE=c:\users\akshay\appdata\local\programs\python\python37\python.exe -DCMAKE_L
IBRARY_OUTPUT_DIRECTORY_RELEASE=C:\Users\Akshay\AppData\Local\Temp\pip-install-8
qdv7218\dlib\build\lib.win-amd64-3.7 -A x64'
-- Building for: NMake Makefiles
CMake Error in CMakeLists.txt:
Generator
NMake Makefiles
does not support platform specification, but platform
x64
was specified.
CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!
See also "C:/Users/Akshay/AppData/Local/Temp/pip-install-8qdv7218/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\Akshay\AppData\Local\Temp\pip-install-8qdv7218\dlib\setup.p
y", line 261, in <module>
'Topic :: Software Development',
File "c:\users\akshay\appdata\local\programs\python\python37\lib\site-pack
ages\setuptools\__init__.py", line 145, in setup
return distutils.core.setup(**attrs)
File "c:\users\akshay\appdata\local\programs\python\python37\lib\distutils
\core.py", line 148, in setup
dist.run_commands()
File "c:\users\akshay\appdata\local\programs\python\python37\lib\distutils
\dist.py", line 966, in run_commands
self.run_command(cmd)
File "c:\users\akshay\appdata\local\programs\python\python37\lib\distutils
\dist.py", line 985, in run_command
cmd_obj.run()
File "c:\users\akshay\appdata\local\programs\python\python37\lib\site-pack
ages\setuptools\command\install.py", line 61, in run
return orig.install.run(self)
File "c:\users\akshay\appdata\local\programs\python\python37\lib\distutils
\command\install.py", line 545, in run
self.run_command('build')
File "c:\users\akshay\appdata\local\programs\python\python37\lib\distutils
\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "c:\users\akshay\appdata\local\programs\python\python37\lib\distutils
\dist.py", line 985, in run_command
cmd_obj.run()
File "c:\users\akshay\appdata\local\programs\python\python37\lib\distutils
\command\build.py", line 135, in run
self.run_command(cmd_name)
File "c:\users\akshay\appdata\local\programs\python\python37\lib\distutils
\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "c:\users\akshay\appdata\local\programs\python\python37\lib\distutils
\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\Akshay\AppData\Local\Temp\pip-install-8qdv7218\dlib\setup.p
y", line 135, in run
self.build_extension(ext)
File "C:\Users\Akshay\AppData\Local\Temp\pip-install-8qdv7218\dlib\setup.p
y", line 172, in build_extension
subprocess.check_call(cmake_setup, cwd=build_folder)
File "c:\users\akshay\appdata\local\programs\python\python37\lib\subproces
s.py", line 347, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', 'C:\\Users\\Akshay\\AppDat
a\\Local\\Temp\\pip-install-8qdv7218\\dlib\\tools\\python', '-DCMAKE_LIBRARY_OUT
PUT_DIRECTORY=C:\\Users\\Akshay\\AppData\\Local\\Temp\\pip-install-8qdv7218\\dli
b\\build\\lib.win-amd64-3.7', '-DPYTHON_EXECUTABLE=c:\\users\\akshay\\appdata\\l
ocal\\programs\\python\\python37\\python.exe', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY
_RELEASE=C:\\Users\\Akshay\\AppData\\Local\\Temp\\pip-install-8qdv7218\\dlib\\bu
ild\\lib.win-amd64-3.7', '-A', 'x64']' returned non-zero exit status 1.
----------------------------------------
ERROR: Command "'c:\users\akshay\appdata\local\programs\python\python37\python.e
xe' -u -c 'import setuptools, tokenize;__file__='"'"'C:\\Users\\Akshay\\AppData\
\Local\\Temp\\pip-install-8qdv7218\\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:\Us
ers\Akshay\AppData\Local\Temp\pip-record-dupqe8e6\install-record.txt' --single-v
ersion-externally-managed --compile" failed with error code 1 in C:\Users\Akshay
\AppData\Local\Temp\pip-install-8qdv7218\dlib\
C:\Users\suraj>pip install dlib
Collecting dlib
Using cached https://files.pythonhosted.org/packages/35/8d/e4ddf60452e2fb1ce3164f774e68968b3f110f1cb4cd353235d56875799e/dlib-19.16.0.tar.gz
Building wheels for collected packages: dlib
Running setup.py bdist_wheel for dlib ... error
Complete output from command c:\users\suraj\appdata\local\programs\python\python37\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\suraj\\AppData\\Local\\Temp\\pip-install-ytzp5t26\\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\suraj\AppData\Local\Temp\pip-wheel-mu6pctca --python-tag cp37:
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.2 (tags/v3.7.2:9a3ffc0492, Dec 23 2018, 23:09:28) [MSC v.1916 64 bit (AMD64)]
Invoking CMake setup: 'cmake C:\Users\suraj\AppData\Local\Temp\pip-install-ytzp5t26\dlib\tools\python -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\suraj\AppData\Local\Temp\pip-install-ytzp5t26\dlib\build\lib.win-amd64-3.7 -DPYTHON_EXECUTABLE=c:\users\suraj\appdata\local\programs\python\python37\python.exe -DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\Users\suraj\AppData\Local\Temp\pip-install-ytzp5t26\dlib\build\lib.win-amd64-3.7 -A x64'
-- Building for: NMake Makefiles
CMake Error in CMakeLists.txt:
Generator
NMake Makefiles
**does not support platform specification, but platform
x64**
was specified.
**CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage**
-- Configuring incomplete, errors occurred!
See also "C:/Users/suraj/AppData/Local/Temp/pip-install-ytzp5t26/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\suraj\AppData\Local\Temp\pip-install-ytzp5t26\dlib\setup.py", line 257, in <module>
'Topic :: Software Development',
File "c:\users\suraj\appdata\local\programs\python\python37\lib\site-packages\setuptools\__init__.py", line 143, in setup
return distutils.core.setup(**attrs)
File "c:\users\suraj\appdata\local\programs\python\python37\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "c:\users\suraj\appdata\local\programs\python\python37\lib\distutils\dist.py", line 966, in run_commands
self.run_command(cmd)
File "c:\users\suraj\appdata\local\programs\python\python37\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "c:\users\suraj\appdata\local\programs\python\python37\lib\site-packages\wheel\bdist_wheel.py", line 188, in run
self.run_command('build')
File "c:\users\suraj\appdata\local\programs\python\python37\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "c:\users\suraj\appdata\local\programs\python\python37\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "c:\users\suraj\appdata\local\programs\python\python37\lib\distutils\command\build.py", line 135, in run
self.run_command(cmd_name)
File "c:\users\suraj\appdata\local\programs\python\python37\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "c:\users\suraj\appdata\local\programs\python\python37\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\suraj\AppData\Local\Temp\pip-install-ytzp5t26\dlib\setup.py", line 133, in run
self.build_extension(ext)
File "C:\Users\suraj\AppData\Local\Temp\pip-install-ytzp5t26\dlib\setup.py", line 170, in build_extension
subprocess.check_call(cmake_setup, cwd=build_folder)
File "c:\users\suraj\appdata\local\programs\python\python37\lib\subprocess.py", line 347, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', 'C:\\Users\\suraj\\AppData\\Local\\Temp\\pip-install-ytzp5t26\\dlib\\tools\\python', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\\Users\\suraj\\AppData\\Local\\Temp\\pip-install-ytzp5t26\\dlib\\build\\lib.win-amd64-3.7', '-DPYTHON_EXECUTABLE=c:\\users\\suraj\\appdata\\local\\programs\\python\\python37\\python.exe', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\\Users\\suraj\\AppData\\Local\\Temp\\pip-install-ytzp5t26\\dlib\\build\\lib.win-amd64-3.7', '-A', 'x64']' returned non-zero exit status 1.
----------------------------------------
**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
Complete output from command c:\users\suraj\appdata\local\programs\python\python37\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\suraj\\AppData\\Local\\Temp\\pip-install-ytzp5t26\\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\suraj\AppData\Local\Temp\pip-record-adx5_t4v\install-record.txt --single-version-externally-managed --compile:
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.2 (tags/v3.7.2:9a3ffc0492, Dec 23 2018, 23:09:28) [MSC v.1916 64 bit (AMD64)]
Invoking CMake setup: 'cmake C:\Users\suraj\AppData\Local\Temp\pip-install-ytzp5t26\dlib\tools\python -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\suraj\AppData\Local\Temp\pip-install-ytzp5t26\dlib\build\lib.win-amd64-3.7 -DPYTHON_EXECUTABLE=c:\users\suraj\appdata\local\programs\python\python37\python.exe -DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\Users\suraj\AppData\Local\Temp\pip-install-ytzp5t26\dlib\build\lib.win-amd64-3.7 -A x64'
-- Building for: NMake Makefiles
CMake Error in CMakeLists.txt:
Generator
NMake Makefiles
does not support platform specification, but platform
x64
was specified.
CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!
See also "C:/Users/suraj/AppData/Local/Temp/pip-install-ytzp5t26/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\suraj\AppData\Local\Temp\pip-install-ytzp5t26\dlib\setup.py", line 257, in <module>
'Topic :: Software Development',
File "c:\users\suraj\appdata\local\programs\python\python37\lib\site-packages\setuptools\__init__.py", line 143, in setup
return distutils.core.setup(**attrs)
File "c:\users\suraj\appdata\local\programs\python\python37\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "c:\users\suraj\appdata\local\programs\python\python37\lib\distutils\dist.py", line 966, in run_commands
self.run_command(cmd)
File "c:\users\suraj\appdata\local\programs\python\python37\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "c:\users\suraj\appdata\local\programs\python\python37\lib\site-packages\setuptools\command\install.py", line 61, in run
return orig.install.run(self)
File "c:\users\suraj\appdata\local\programs\python\python37\lib\distutils\command\install.py", line 545, in run
self.run_command('build')
File "c:\users\suraj\appdata\local\programs\python\python37\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "c:\users\suraj\appdata\local\programs\python\python37\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "c:\users\suraj\appdata\local\programs\python\python37\lib\distutils\command\build.py", line 135, in run
self.run_command(cmd_name)
File "c:\users\suraj\appdata\local\programs\python\python37\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "c:\users\suraj\appdata\local\programs\python\python37\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\suraj\AppData\Local\Temp\pip-install-ytzp5t26\dlib\setup.py", line 133, in run
self.build_extension(ext)
File "C:\Users\suraj\AppData\Local\Temp\pip-install-ytzp5t26\dlib\setup.py", line 170, in build_extension
subprocess.check_call(cmake_setup, cwd=build_folder)
File "c:\users\suraj\appdata\local\programs\python\python37\lib\subprocess.py", line 347, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', 'C:\\Users\\suraj\\AppData\\Local\\Temp\\pip-install-ytzp5t26\\dlib\\tools\\python', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\\Users\\suraj\\AppData\\Local\\Temp\\pip-install-ytzp5t26\\dlib\\build\\lib.win-amd64-3.7', '-DPYTHON_EXECUTABLE=c:\\users\\suraj\\appdata\\local\\programs\\python\\python37\\python.exe', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\\Users\\suraj\\AppData\\Local\\Temp\\pip-install-ytzp5t26\\dlib\\build\\lib.win-amd64-3.7', '-A', 'x64']' returned non-zero exit status 1.
----------------------------------------
Command "c:\users\suraj\appdata\local\programs\python\python37\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\suraj\\AppData\\Local\\Temp\\pip-install-ytzp5t26\\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\suraj\AppData\Local\Temp\pip-record-adx5_t4v\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\suraj\AppData\Local\Temp\pip-install-ytzp5t26\dlib\
This is the Error I'm getting while installing dlib using pip in command prompt.
I already have openCV and matplotlib and numpy.
I faced the same problem a while back. I did a few things and it worked
Install C and C++ compilers and add them to path.
Install visual studio 2015 (VS2015) down-loader. (any other version might not work). This stack overflow thread may help: How to download Visual Studio Community Edition 2015 (not 2017)
Install all the dependencies through VS2015.(support for C, C++, MS Build, windows SDK etc)
Try and use pip install dlib again.
I hope this helps!
For those who are facing the same problem but using mac OS --> I did the below steps and resolved the same issue. I have macOS Big Sur 11.1 with python 3.8.3.
pip3 install cmake
pip3 install dlib
OK for the record here: On debian 10. pip install dlib fails even with pip install cmake first. Solution? sudo apt install libopenblas-dev. The output of pip install dlib --verbose mentions it as an optional install that makes your code run faster. Turns out without installing this first the install fails every time. With it the install succeeds.
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 can download the 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...hopefully
You may need to install cmake first: "pip install cmake"
Then install dlib i.e: "pip install dlib".
Will surely work 100%.
Note: You must have a fast processor for building wheel else it'll take more than 5mins.
I faced many error while installing dlib and solve by using below .whl:
pip install https://pypi.python.org/packages/da/06/bd3e241c4eb0a662914b3b4875fc52dd176a9db0d4a2c915ac2ad8800e9e/dlib-19.7.0-cp36-cp36m-win_amd64.whl#md5=b7330a5b2d46420343fbed5df69e6a3f
Download wheel from this link
This might help :)
This question already has answers here:
dlib installation on Windows 10
(19 answers)
Closed 3 years ago.
Everytime I do pip3 install dlib, I receive errors such as "Failed with error code 1" and "CMake Error in CMakeLists.txt" and I have noticed that some work when I try to install other modules like numpy or pillow. And I am also using Visual Studio Code and bash for the terminal. I have tried to do it in the command prompt but it comes out with the same error.
Here is the full report:
David#Davids-PC MINGW64 ~/Desktop/Hello
$ pip3 install dlib
Collecting dlib
Using cached https://files.pythonhosted.org/packages/df/aa/6a9bb2a763107bb2606d6ee1aa65fcd3b51375a9ef6436e9c9280b0dd63c/dlib-19.15.0.tar.gz
Installing collected packages: dlib
Running setup.py install for dlib ... error
Complete output from command c:\users\david\appdata\local\programs\python\python37\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\David\\AppData\\Local\\Temp\\pip-install-56zr1ps9\\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\David\AppData\Local\Temp\pip-record-zk0bruog\install-record.txt --single-version-externally-managed --compile:
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.0 (v3.7.0:1bf9cc5093, Jun 27 2018, 04:59:51) [MSC v.1914 64 bit (AMD64)]
Invoking CMake setup: 'cmake C:\Users\David\AppData\Local\Temp\pip-install-56zr1ps9\dlib\tools\python -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\David\AppData\Local\Temp\pip-install-56zr1ps9\dlib\build\lib.win-amd64-3.7 -DPYTHON_EXECUTABLE=c:\users\david\appdata\local\programs\python\python37\python.exe -DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\Users\David\AppData\Local\Temp\pip-install-56zr1ps9\dlib\build\lib.win-amd64-3.7 -A x64'
-- Building for: NMake Makefiles
CMake Error in CMakeLists.txt:
Generator
NMake Makefiles
does not support platform specification, but platform
x64
was specified.
CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!
See also "C:/Users/David/AppData/Local/Temp/pip-install-56zr1ps9/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\David\AppData\Local\Temp\pip-install-56zr1ps9\dlib\setup.py", line 257, in <module>
'Topic :: Software Development',
File "c:\users\david\appdata\local\programs\python\python37\lib\site-packages\setuptools\__init__.py", line 131, in setup
return distutils.core.setup(**attrs)
File "c:\users\david\appdata\local\programs\python\python37\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "c:\users\david\appdata\local\programs\python\python37\lib\distutils\dist.py", line 966, in run_commands
self.run_command(cmd)
File "c:\users\david\appdata\local\programs\python\python37\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "c:\users\david\appdata\local\programs\python\python37\lib\site-packages\setuptools\command\install.py", line 61, in run
return orig.install.run(self)
File "c:\users\david\appdata\local\programs\python\python37\lib\distutils\command\install.py", line 545, in run
self.run_command('build')
File "c:\users\david\appdata\local\programs\python\python37\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "c:\users\david\appdata\local\programs\python\python37\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "c:\users\david\appdata\local\programs\python\python37\lib\distutils\command\build.py", line 135, in run
self.run_command(cmd_name)
File "c:\users\david\appdata\local\programs\python\python37\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "c:\users\david\appdata\local\programs\python\python37\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\David\AppData\Local\Temp\pip-install-56zr1ps9\dlib\setup.py", line 133, in run
self.build_extension(ext)
File "C:\Users\David\AppData\Local\Temp\pip-install-56zr1ps9\dlib\setup.py", line 170, in build_extension
subprocess.check_call(cmake_setup, cwd=build_folder)
File "c:\users\david\appdata\local\programs\python\python37\lib\subprocess.py", line 328, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', 'C:\\Users\\David\\AppData\\Local\\Temp\\pip-install-56zr1ps9\\dlib\\tools\\python', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\\Users\\David\\AppData\\Local\\Temp\\pip-install-56zr1ps9\\dlib\\build\\lib.win-amd64-3.7', '-DPYTHON_EXECUTABLE=c:\\users\\david\\appdata\\local\\programs\\python\\python37\\python.exe', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\\Users\\David\\AppData\\Local\\Temp\\pip-install-56zr1ps9\\dlib\\build\\lib.win-amd64-3.7', '-A', 'x64']' returned non-zero exit status 1.
----------------------------------------
Command "c:\users\david\appdata\local\programs\python\python37\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\David\\AppData\\Local\\Temp\\pip-install-56zr1ps9\\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\David\AppData\Local\Temp\pip-record-zk0bruog\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\David\AppData\Local\Temp\pip-install-56zr1ps9\dlib\
Thank you for your suggestions but I installed it through a different way by using Anaconda with the command Conda install dlib in the Anaconda Prompt then created an environment for it. After that, I used Anaconda 5.3.0 in VSCode then started coding.