C:\Users\Administrator>pip install dlib
Collecting dlib
Using cached dlib-19.23.1.tar.gz (7.4 MB)
Preparing metadata (setup.py) ... done
Building wheels for collected packages: dlib
Building wheel for dlib (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py bdist_wheel did not run successfully.
│ exit code: 1
╰─> [69 lines of output]
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
C:\Users\Administrator\AppData\Local\Temp\pip-install-2a903ymc\dlib_46f2d4f176b740d987b8fef7af7b8ef9\setup.py:129: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
if LooseVersion(cmake_version) < '3.1.0':
Building extension for Python 3.10.4 (tags/v3.10.4:9d38120, Mar 23 2022, 23:13:41) [MSC v.1929 64 bit (AMD64)]
Invoking CMake setup: 'cmake C:\Users\Administrator\AppData\Local\Temp\pip-install-2a903ymc\dlib_46f2d4f176b740d987b8fef7af7b8ef9\tools\python -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\Administrator\AppData\Local\Temp\pip-install-2a903ymc\dlib_46f2d4f176b740d987b8fef7af7b8ef9\build\lib.win-amd64-3.10 -DPYTHON_EXECUTABLE=C:\Users\Administrator\AppData\Local\Programs\Python\Python310\python.exe -DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\Users\Administrator\AppData\Local\Temp\pip-install-2a903ymc\dlib_46f2d4f176b740d987b8fef7af7b8ef9\build\lib.win-amd64-3.10 -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 2, in <module>
File "<pip-setuptools-caller>", line 34, in <module>
File "C:\Users\Administrator\AppData\Local\Temp\pip-install-2a903ymc\dlib_46f2d4f176b740d987b8fef7af7b8ef9\setup.py", line 222, in <module>
setup(
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\__init__.py", line 79, in setup
return distutils.core.setup(**attrs)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\_distutils\core.py", line 148, in setup
return run_commands(dist)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\_distutils\core.py", line 163, in run_commands
dist.run_commands()
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\_distutils\dist.py", line 967, in run_commands
self.run_command(cmd)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\dist.py", line 1196, in run_command
super().run_command(command)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\_distutils\dist.py", line 986, in run_command
cmd_obj.run()
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\wheel\bdist_wheel.py", line 299, in run
self.run_command('build')
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\_distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\dist.py", line 1196, in run_command
super().run_command(command)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\_distutils\dist.py", line 986, in run_command
cmd_obj.run()
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\_distutils\command\build.py", line 135, in run
self.run_command(cmd_name)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\_distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\dist.py", line 1196, in run_command
super().run_command(command)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\_distutils\dist.py", line 986, in run_command
cmd_obj.run()
File "C:\Users\Administrator\AppData\Local\Temp\pip-install-2a903ymc\dlib_46f2d4f176b740d987b8fef7af7b8ef9\setup.py", line 134, in run
self.build_extension(ext)
File "C:\Users\Administrator\AppData\Local\Temp\pip-install-2a903ymc\dlib_46f2d4f176b740d987b8fef7af7b8ef9\setup.py", line 171, in build_extension
subprocess.check_call(cmake_setup, cwd=build_folder)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\subprocess.py", line 369, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', 'C:\\Users\\Administrator\\AppData\\Local\\Temp\\pip-install-2a903ymc\\dlib_46f2d4f176b740d987b8fef7af7b8ef9\\tools\\python', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\\Users\\Administrator\\AppData\\Local\\Temp\\pip-install-2a903ymc\\dlib_46f2d4f176b740d987b8fef7af7b8ef9\\build\\lib.win-amd64-3.10', '-DPYTHON_EXECUTABLE=C:\\Users\\Administrator\\AppData\\Local\\Programs\\Python\\Python310\\python.exe', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\\Users\\Administrator\\AppData\\Local\\Temp\\pip-install-2a903ymc\\dlib_46f2d4f176b740d987b8fef7af7b8ef9\\build\\lib.win-amd64-3.10', '-A', 'x64']' returned non-zero exit status 1.
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
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: subprocess-exited-with-error
× Running setup.py install for dlib did not run successfully.
│ exit code: 1
╰─> [73 lines of output]
running install
C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\command\install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
running build
running build_py
package init file 'tools\python\dlib\__init__.py' not found (or not a regular file)
running build_ext
C:\Users\Administrator\AppData\Local\Temp\pip-install-2a903ymc\dlib_46f2d4f176b740d987b8fef7af7b8ef9\setup.py:129: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
if LooseVersion(cmake_version) < '3.1.0':
Building extension for Python 3.10.4 (tags/v3.10.4:9d38120, Mar 23 2022, 23:13:41) [MSC v.1929 64 bit (AMD64)]
Invoking CMake setup: 'cmake C:\Users\Administrator\AppData\Local\Temp\pip-install-2a903ymc\dlib_46f2d4f176b740d987b8fef7af7b8ef9\tools\python -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\Administrator\AppData\Local\Temp\pip-install-2a903ymc\dlib_46f2d4f176b740d987b8fef7af7b8ef9\build\lib.win-amd64-3.10 -DPYTHON_EXECUTABLE=C:\Users\Administrator\AppData\Local\Programs\Python\Python310\python.exe -DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\Users\Administrator\AppData\Local\Temp\pip-install-2a903ymc\dlib_46f2d4f176b740d987b8fef7af7b8ef9\build\lib.win-amd64-3.10 -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 2, in <module>
File "<pip-setuptools-caller>", line 34, in <module>
File "C:\Users\Administrator\AppData\Local\Temp\pip-install-2a903ymc\dlib_46f2d4f176b740d987b8fef7af7b8ef9\setup.py", line 222, in <module>
setup(
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\__init__.py", line 79, in setup
return distutils.core.setup(**attrs)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\_distutils\core.py", line 148, in setup
return run_commands(dist)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\_distutils\core.py", line 163, in run_commands
dist.run_commands()
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\_distutils\dist.py", line 967, in run_commands
self.run_command(cmd)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\dist.py", line 1196, in run_command
super().run_command(command)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\_distutils\dist.py", line 986, in run_command
cmd_obj.run()
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\command\install.py", line 68, in run
return orig.install.run(self)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\_distutils\command\install.py", line 670, in run
self.run_command('build')
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\_distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\dist.py", line 1196, in run_command
super().run_command(command)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\_distutils\dist.py", line 986, in run_command
cmd_obj.run()
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\_distutils\command\build.py", line 135, in run
self.run_command(cmd_name)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\_distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\dist.py", line 1196, in run_command
super().run_command(command)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\_distutils\dist.py", line 986, in run_command
cmd_obj.run()
File "C:\Users\Administrator\AppData\Local\Temp\pip-install-2a903ymc\dlib_46f2d4f176b740d987b8fef7af7b8ef9\setup.py", line 134, in run
self.build_extension(ext)
File "C:\Users\Administrator\AppData\Local\Temp\pip-install-2a903ymc\dlib_46f2d4f176b740d987b8fef7af7b8ef9\setup.py", line 171, in build_extension
subprocess.check_call(cmake_setup, cwd=build_folder)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\subprocess.py", line 369, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', 'C:\\Users\\Administrator\\AppData\\Local\\Temp\\pip-install-2a903ymc\\dlib_46f2d4f176b740d987b8fef7af7b8ef9\\tools\\python', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\\Users\\Administrator\\AppData\\Local\\Temp\\pip-install-2a903ymc\\dlib_46f2d4f176b740d987b8fef7af7b8ef9\\build\\lib.win-amd64-3.10', '-DPYTHON_EXECUTABLE=C:\\Users\\Administrator\\AppData\\Local\\Programs\\Python\\Python310\\python.exe', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\\Users\\Administrator\\AppData\\Local\\Temp\\pip-install-2a903ymc\\dlib_46f2d4f176b740d987b8fef7af7b8ef9\\build\\lib.win-amd64-3.10', '-A', 'x64']' returned non-zero exit status 1.
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure
× Encountered error while trying to install package.
╰─> dlib
note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.