C:\python\Scripts>pip install dlib
Collecting dlib
Using cached dlib-19.19.0.tar.gz (3.2 MB)
Installing collected packages: dlib
Running setup.py install for dlib ... error
ERROR: Command errored out with exit status 1:
command: 'c:\python\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Work\\AppData\\Local\\Temp\\pip-install-m0sdf_bv\\dlib\\setup.py'"'"'; __file__='"'"'C:\\Users\\Work\\AppData\\Local\\Temp\\pip-install-m0sdf_bv\\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\Work\AppData\Local\Temp\pip-record-alg_6b9y\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\python\Include\dlib'
cwd: C:\Users\Work\AppData\Local\Temp\pip-install-m0sdf_bv\dlib\
Complete output (47 lines):
running install
running build
running build_py
package init file 'dlib\__init__.py' not found (or not a regular file)
running build_ext
Traceback (most recent call last):
File "c:\python\lib\runpy.py", line 193, in _run_module_as_main
return _run_code(code, main_globals, None,
File "c:\python\lib\runpy.py", line 86, in _run_code
exec(code, run_globals)
File "C:\python\Scripts\cmake.exe\__main__.py", line 4, in <module>
ModuleNotFoundError: No module named 'cmake'
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\Work\AppData\Local\Temp\pip-install-m0sdf_bv\dlib\setup.py", line 223, in <module>
setup(
File "c:\python\lib\site-packages\setuptools\__init__.py", line 145, in setup
return distutils.core.setup(**attrs)
File "c:\python\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "c:\python\lib\distutils\dist.py", line 966, in run_commands
self.run_command(cmd)
File "c:\python\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "c:\python\lib\site-packages\setuptools\command\install.py", line 61, in run
return orig.install.run(self)
File "c:\python\lib\distutils\command\install.py", line 545, in run
self.run_command('build')
File "c:\python\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "c:\python\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "c:\python\lib\distutils\command\build.py", line 135, in run
self.run_command(cmd_name)
File "c:\python\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "c:\python\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\Work\AppData\Local\Temp\pip-install-m0sdf_bv\dlib\setup.py", line 129, in run
cmake_version = self.get_cmake_version()
File "C:\Users\Work\AppData\Local\Temp\pip-install-m0sdf_bv\dlib\setup.py", line 120, in get_cmake_version
out = subprocess.check_output(['cmake', '--version'])
File "c:\python\lib\subprocess.py", line 411, in check_output
return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
File "c:\python\lib\subprocess.py", line 512, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['cmake', '--version']' returned non-zero exit status 1.
----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\python\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Work\\AppData\\Local\\Temp\\pip-install-m0sdf_bv\\dlib\\setup.py'"'"'; __file__='"'"'C:\\Users\\Work\\AppData\\Local\\Temp\\pip-install-m0sdf_bv\\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\Work\AppData\Local\Temp\pip-record-alg_6b9y\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\python\Include\dlib' Check the logs for full command output.
这是我运行pip install dlib时出现的错误