我无法使用pip安装dlib。有什么问题?

问题描述 投票:-2回答:1

错误:命令错误,退出状态为1:命令:'C:\ Users \ dell \ Anaconda3 \ python.exe'-u -c'导入sys,setuptools,标记化sys.argv [0] ='“”“'C:\ Users \ dell \ AppData \ Local \ Temp \ pip-install-h7ictrqd \ dlib \ setup.py'”“';;文件 ='“'”'C:\ Users \ dell \ AppData \ Local \ Temp \ pip-install-h7ictrqd \ dlib \ setup.py'“'” ;; f = getattr(tokenize,'“'”'open'“'”',打开)(文件); 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-nd2ljdx5'--python标签cp37cwd:C:\ Users \ dell \ AppData \ Local \ Temp \ pip-install-h7ictrqd \ dlib \完成输出(53行):运行bdist_wheel运行构建运行未找到build_py软件包初始化文件'dlib__init__.py'(或常规文件)运行build_ext Traceback(最近一次调用为last):文件“ C:\ Users \ dell \ AppData \ Local \ Temp \ pip-install-h7ictrqd \ dlib \ setup.py”,第120行,在get_cmake_version中out = subprocess.check_output(['cmake','--version'])文件“ C:\ Users \ dell \ Anaconda3 \ lib \ subprocess.py”,行395,在check_output中** kwargs).stdout运行中的文件“ C:\ Users \ dell \ Anaconda3 \ lib \ subprocess.py”,第472行使用Popen(* popenargs,** kwargs)作为进程:init中的文件“ C:\ Users \ dell \ Anaconda3 \ lib \ subprocess.py”,行775restore_signals,start_new_session)_execute_child中的文件“ C:\ Users \ dell \ Anaconda3 \ lib \ subprocess.py”,行1178startupinfo)FileNotFoundError:[WinError 2]系统找不到指定的文件

在处理以上异常期间,发生了另一个异常:

追踪(最近通话):文件“”,第1行,位于文件“ C:\ Users \ dell \ AppData \ Local \ Temp \ pip-install-h7ictrqd \ dlib \ setup.py”,261行,在“主题::软件开发”,文件“ C:\ Users \ dell \ Anaconda3 \ lib \ site-packages \ setuptools__init __。py”,设置中的第145行返回distutils.core.setup(** attrs)安装程序中的文件“ C:\ Users \ dell \ Anaconda3 \ lib \ distutils \ core.py”,第148行dist.run_commands()在run_commands中,文件“ C:\ Users \ dell \ Anaconda3 \ lib \ distutils \ dist.py”,行966self.run_command(cmd)在run_command中的文件“ C:\ Users \ dell \ Anaconda3 \ lib \ distutils \ dist.py”,行985cmd_obj.run()文件“ C:\ Users \ dell \ Anaconda3 \ lib \ site-packages \ wheel \ bdist_wheel.py”,行192,运行中self.run_command('build')在run_command中,文件“ C:\ Users \ dell \ Anaconda3 \ lib \ distutils \ cmd.py”,第313行self.distribution.run_command(命令)在run_command中的文件“ C:\ Users \ dell \ Anaconda3 \ lib \ distutils \ dist.py”,行985cmd_obj.run()运行中的文件“ C:\ Users \ dell \ Anaconda3 \ lib \ distutils \ command \ build.py”,第135行self.run_command(cmd_name)在run_command中,文件“ C:\ Users \ dell \ Anaconda3 \ lib \ distutils \ cmd.py”,第313行self.distribution.run_command(命令)在run_command中的文件“ C:\ Users \ dell \ Anaconda3 \ lib \ distutils \ dist.py”,行985cmd_obj.run()文件“ C:\ Users \ dell \ AppData \ Local \ Temp \ pip-install-h7ictrqd \ dlib \ setup.py”,129行,正在运行cmake_version = self.get_cmake_version()文件“ C:\ Users \ dell \ AppData \ Local \ Temp \ pip-install-h7ictrqd \ dlib \ setup.py”,第125行,在get_cmake_version中“ \ n *************************************************** ******************** \ n“)RuntimeError:


CMake必须安装以构建以下扩展名:dlib



错误:dlib的构建轮失败运行dlib的setup.py clean运行失败dlib的构建失败安装收集的软件包:dlib dlib的运行setup.py install ...错误错误:命令错误,退出状态为1:命令:'C:\ Users \ dell \ Anaconda3 \ python.exe'-u -c'import sys,setuptools,tokenize; sys.argv [0] ='“'”'C:\ Users \ dell \ AppData \ Local \ Temp \ pip-install-h7ictrqd \ dlib \ setup.py'“'”';file ='“'”'C:\ Users \ dell \ AppData \ Local \ Temp \ pip-install-h7ictrqd \ dlib \ setup.py'“'”'; f = getattr(tokenize,'“' “'open'”'“',打开)(文件); code = f.read()。replace('”'“'\ r \ n'”'“','”'“'\ n'“'”'); f.close(); exec(compile(code,file,'“'”'exec'“'”'))''安装--record'C:\ Users \ dell \ AppData \ Local \ Temp \ pip-record-8fa9q7wn \ install-record.txt'-单一版本-外部管理-编译CWD:C:\ Users \ dell \ AppData \ Local \ Temp \ pip-install-h7ictrqd \ dlib \完整输出(55行):运行安装运行构建运行build_py找不到包初始化文件“ dlib__init __。py”(或不是常规文件)运行build_ext追溯(最近一次通话):在get_cmake_version中的第120行,文件“ C:\ Users \ dell \ AppData \ Local \ Temp \ pip-install-h7ictrqd \ dlib \ setup.py”out = subprocess.check_output(['cmake','--version'])文件“ C:\ Users \ dell \ Anaconda3 \ lib \ subprocess.py”,行395,在check_output中** kwargs).stdout运行中的文件“ C:\ Users \ dell \ Anaconda3 \ lib \ subprocess.py”,第472行使用Popen(* popenargs,** kwargs)作为进程:init中的文件“ C:\ Users \ dell \ Anaconda3 \ lib \ subprocess.py”,行775restore_signals,start_new_session)_execute_child中的文件“ C:\ Users \ dell \ Anaconda3 \ lib \ subprocess.py”,行1178startupinfo)FileNotFoundError:[WinError 2]系统找不到指定的文件

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:\Users\dell\AppData\Local\Temp\pip-install-h7ictrqd\dlib\setup.py", line 261, in <module>
    'Topic :: Software Development',
  File "C:\Users\dell\Anaconda3\lib\site-packages\setuptools\__init__.py", line 145, in setup
    return distutils.core.setup(**attrs)
  File "C:\Users\dell\Anaconda3\lib\distutils\core.py", line 148, in setup
    dist.run_commands()
  File "C:\Users\dell\Anaconda3\lib\distutils\dist.py", line 966, in run_commands
    self.run_command(cmd)
  File "C:\Users\dell\Anaconda3\lib\distutils\dist.py", line 985, in run_command
    cmd_obj.run()
  File "C:\Users\dell\Anaconda3\lib\site-packages\setuptools\command\install.py", line 61, in run
    return orig.install.run(self)
  File "C:\Users\dell\Anaconda3\lib\distutils\command\install.py", line 545, in run
    self.run_command('build')
  File "C:\Users\dell\Anaconda3\lib\distutils\cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "C:\Users\dell\Anaconda3\lib\distutils\dist.py", line 985, in run_command
    cmd_obj.run()
  File "C:\Users\dell\Anaconda3\lib\distutils\command\build.py", line 135, in run
    self.run_command(cmd_name)
  File "C:\Users\dell\Anaconda3\lib\distutils\cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "C:\Users\dell\Anaconda3\lib\distutils\dist.py", line 985, in run_command
    cmd_obj.run()
  File "C:\Users\dell\AppData\Local\Temp\pip-install-h7ictrqd\dlib\setup.py", line 129, in run
    cmake_version = self.get_cmake_version()
  File "C:\Users\dell\AppData\Local\Temp\pip-install-h7ictrqd\dlib\setup.py", line 125, in get_cmake_version
    "\n*******************************************************************\n")
RuntimeError:

*******************************************************************
 CMake must be installed to build the following extensions: dlib
*******************************************************************

----------------------------------------

错误:命令错误,退出状态为1:'C:\ Users \ dell \ Anaconda3 \ python.exe'-u -c'import sys,setuptools,tokenize; sys.argv [0] ='“'”'C:\ Users \ dell \ AppData \ Local \ Temp \ pip-install-h7ictrqd \ dlib \ setup.py'“'”'; file ='“'”'C:\ Users \ dell \ AppData \ Local \ Temp \ pip-install-h7ictrqd \ dlib \ setup.py'“'”'; f = getattr(tokenize,'“' “'open'”'“',打开)(文件); code = f.read()。replace('”'“'\ r \ n'”'“','”'“'\ n'“'”'); f.close(); exec(compile(code,file,'“'”'exec'“'”'))'安装-记录'C:\ Users \ dell \ AppData \ Local \ Temp \ pip-record-8fa9q7wn \ install-record.txt'--single-version-externally-managed --compile检查日志以获取完整的命令输出。

pip anaconda python-3.7 dlib
1个回答
0
投票

这是您的错误:

必须安装CMake才能构建以下扩展:dlib

这说明了一切。为了使编译工作正常,您需要安装cmake

但是,由于您正在使用anaconda,因此没有理由使用pip安装dlib。实际上甚至不建议使用pip将软件包安装到conda环境中,如果可以避免的话。就是说,只需使用:

conda install -c conda-forge dlib 

安装

© www.soinside.com 2019 - 2024. All rights reserved.