我正在尝试安装dlib。我已经安装了cmake。
pip install dlib给出错误
已尝试cmake CMakeLists.txt -G“ Visual Studio 16 2019” -A x64
但仍然会出现以下错误。
有人帮我解决
正在运行dlib的setup.py安装...错误错误:命令错误,退出状态为1:命令:'c:\ program files(x86)\ python37-32 \ python.exe'-u -c'import sys,setuptools,tokenize; sys.argv [0] ='“'”'C:\ Users \ 91956 \ AppData \ Local \ Temp \ pip-install-au2p7x8p \ dlib \ setup.py'“'”'; 文件 ='“'”'C:\ Users \ 91956 \ AppData \ Local \ Temp \ pip-install-au2p7x8p \ dlib \ setup.py'“'”'; f = getattr(tokenize,'“' “'open'”'“',打开)(文件); code = f.read()。replace('”'“'\ r \ n'”'“','”'“'\ n'“'”'); f.close(); exec(compile(code,file,'“'”'exec'“'”'))'安装--record'C:\ Users \ 91956 \ AppData \ Local \ Temp \ pip-record-ds4nctnl \ install-record.txt'-单一版本-外部管理-编译CWD:C:\ Users \ 91956 \ AppData \ Local \ Temp \ pip-install-au2p7x8p \ dlib \完整输出(65行):运行安装运行构建运行build_py找不到包初始化文件“ dlib__init __。py”(或不是常规文件)运行build_ext适用于Python 3.7.4的构建扩展(tags / v3.7.4:e09359112e,2019年7月8日,19:29:22)[MSC v.1916 32位(Intel)]调用CMake设置:'cmake C:\ Users \ 91956 \ AppData \ Local \ Temp \ pip-install-au2p7x8p \ dlib \ tools \ python -DCMAKE_LIBRARY_OUTPUT_DIRECTORY = C:\ Users \ 91956 \ AppData \ Local \ Temp \ pip-install- au2p7x8p \ dlib \ build \ lib.win32-3.7 -DPYTHON_EXECUTABLE = c:\ program files(x86)\ python37-32 \ python.exe -DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE = C:\ Users \ 91956 \ AppData \ Local \ Temp \ pip-install- au2p7x8p \ dlib \ build \ lib.win32-3.7'-构建于:Visual Studio 16 2019-C编译器标识为MSVC 19.22.27905.0-CXX编译器标识为MSVC 19.22.27905.0-检查工作的C编译器:C:/ Program Files(x86)/ Microsoft Visual Studio / 2019 / Community / VC / Tools / MSVC / 14.22.27905 / bin / Hostx64 / x64 / cl.exe-检查工作的C编译器:C:/ Program Files(x86)/ Microsoft Visual Studio / 2019 / Community / VC / Tools / MSVC / 14.22.27905 / bin / Hostx64 / x64 / cl.exe-检测C编译器ABI信息-检测C编译器ABI信息-完成-检测C编译功能-检测C编译功能-完成-检查工作的CXX编译器:C:/ Program Files(x86)/ Microsoft Visual Studio / 2019 / Community / VC / Tools / MSVC / 14.22.27905 / bin / Hostx64 / x64 / cl.exe-检查工作的CXX编译器:C:/ Program Files(x86)/ Microsoft Visual Studio / 2019 / Community / VC / Tools / MSVC / 14.22.27905 / bin / Hostx64 / x64 / cl.exe-检测CXX编译器ABI信息-检测CXX编译器ABI信息-完成-检测CXX编译功能-检测CXX编译功能-完成-找到PythonInterp:C:/ Program Files(x86)/Python37-32/python.exe(找到版本“ 3.7.4”)在C:/Users/91956/AppData/Local/Temp/pip-install-au2p7x8p/dlib/dlib/external/pybind11/tools/FindPythonLibsNew.cmake:122(消息)中的CMake错误:Python配置失败:Python是32位,选择的编译器是64位呼叫堆栈(最近的呼叫优先):C:/Users/91956/AppData/Local/Temp/pip-install-au2p7x8p/dlib/dlib/external/pybind11/tools/pybind11Tools.cmake:16(find_package)C:/Users/91956/AppData/Local/Temp/pip-install-au2p7x8p/dlib/dlib/external/pybind11/CMakeLists.txt:33(包括)
-- Configuring incomplete, errors occurred!
See also "C:/Users/91956/AppData/Local/Temp/pip-install-au2p7x8p/dlib/build/temp.win32-3.7/Release/CMakeFiles/CMakeOutput.log".
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\91956\AppData\Local\Temp\pip-install-au2p7x8p\dlib\setup.py", line 261, in <module>
'Topic :: Software Development',
File "c:\program files (x86)\python37-32\lib\site-packages\setuptools\__init__.py", line 145, in setup
return distutils.core.setup(**attrs)
File "c:\program files (x86)\python37-32\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "c:\program files (x86)\python37-32\lib\distutils\dist.py", line 966, in run_commands
self.run_command(cmd)
File "c:\program files (x86)\python37-32\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "c:\program files (x86)\python37-32\lib\site-packages\setuptools\command\install.py", line 61, in run
return orig.install.run(self)
File "c:\program files (x86)\python37-32\lib\distutils\command\install.py", line 545, in run
self.run_command('build')
File "c:\program files (x86)\python37-32\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "c:\program files (x86)\python37-32\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "c:\program files (x86)\python37-32\lib\distutils\command\build.py", line 135, in run
self.run_command(cmd_name)
File "c:\program files (x86)\python37-32\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "c:\program files (x86)\python37-32\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\91956\AppData\Local\Temp\pip-install-au2p7x8p\dlib\setup.py", line 135, in run
self.build_extension(ext)
File "C:\Users\91956\AppData\Local\Temp\pip-install-au2p7x8p\dlib\setup.py", line 172, in build_extension
subprocess.check_call(cmake_setup, cwd=build_folder)
File "c:\program files (x86)\python37-32\lib\subprocess.py", line 347, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', 'C:\\Users\\91956\\AppData\\Local\\Temp\\pip-install-au2p7x8p\\dlib\\tools\\python', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\\Users\\91956\\AppData\\Local\\Temp\\pip-install-au2p7x8p\\dlib\\build\\lib.win32-3.7', '-DPYTHON_EXECUTABLE=c:\\program files (x86)\\python37-32\\python.exe', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\\Users\\91956\\AppData\\Local\\Temp\\pip-install-au2p7x8p\\dlib\\build\\lib.win32-3.7']' returned non-zero exit status 1.
----------------------------------------
错误:命令错误,退出状态为1:'c:\ program files(x86)\ python37-32 \ python.exe'-u -c'import sys,setuptools,tokenize; sys.argv [0] ='“'”'C:\ Users \ 91956 \ AppData \ Local \ Temp \ pip-install-au2p7x8p \ dlib \ setup.py'“'”'; 文件 ='“'”'C:\ Users \ 91956 \ AppData \ Local \ Temp \ pip-install-au2p7x8p \ dlib \ setup.py'“'”'; f = getattr(tokenize,'“' “'open'”'“',打开)(文件); code = f.read()。replace('”'“'\ r \ n'”'“','”'“'\ n'“'”'); f.close(); exec(compile(code,file,'“'”'exec'“'”'))'安装--record'C:\ Users \ 91956 \ AppData \ Local \ Temp \ pip-record-ds4nctnl \ install-record.txt'--single-version-externally-managed --compile检查日志以获取完整的命令输出。
我需要完成安装。
Dlib在python 3.6至3.7.0]版本s中受支持。尝试通过以下命令在anaconda提示符中安装dlib。
步骤1:康达创建-n env_name python = 3.7.0
步骤2:conda激活env_name
步骤3:conda install -c conda-forge dlib = 19.17
-c代表渠道,conda-forge是渠道之一。
您可以在此链接https://repo.anaconda.com/pkgs/main/win-64/中找到所有受conda支持的软件包。>
Anaconda可从https://www.anaconda.com/distribution/#download-section获得