[当Cmake报告错误而无法重新安装时,如何在macOS中安装dlib

问题描述 投票:0回答:1

正在尝试下载dlib for face_recognition,已经下载过openCV,但是在处理过程中遇到错误/

我尝试过:

  1. [pip install dlibpip3 install dlib
  2. brew install dlib

我在1期间遇到了相同的错误,而在2期间遇到了以下错误:

“Error: The following formula
[#, #]
cannot be installed as binary package and must be built from source.
Install the Command Line Tools:
xcode-select –install”

然后我尝试运行xcode-select –intall,也失败了...

无论如何,为了便于阅读,我将尝试为您首先手动选择错误提示,如下所示:

_"ERROR: Command errored out with exit status 1:”_


_“package init file ‘dlib/__init__.py’ not found (or not a regular file)”_


_“Invoking CMake setup:…..
The C compiler identification is unknown
The CXX compiler identification is unknown
Check for working C compiler: /usr/bin/cc — broken”_


_“The C compiler . “/usr/bin/cc” . is not able to compile a simple test program.”_


_“CMake will not be able to correctly generate this project.”_


_” — Configuring incomplete, errors occurred!”_


_“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:”_

-----------------------------------------------------------
Collecting dlib
Using cached https://files.pythonhosted.org/packages/1e/62/aacb236d21fbd08148b1d517d58a9d80ea31bdcd386d26f21f8b23b1eb28/dlib-19.18.0.tar.gz

#error starts here

Building wheels for collected packages: dlib
Building wheel for dlib (setup.py) … error
ERROR: Command errored out with exit status 1:
command: /Users/bear/.virtualenvs/py3_dlib/bin/python3 -u -c ‘import sys, setuptools, tokenize; sys.argv[0] = ‘”‘”‘/private/var/folders/zc/mbmg3rf17ns4v7yfk52qbf680000gn/T/pip-install-zk1urcsc/dlib/setup.py'”‘”‘; __file__='”‘”‘/private/var/folders/zc/mbmg3rf17ns4v7yfk52qbf680000gn/T/pip-install-zk1urcsc/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 /private/var/folders/zc/mbmg3rf17ns4v7yfk52qbf680000gn/T/pip-wheel-vlvkpttg –python-tag cp37
cwd: /private/var/folders/zc/mbmg3rf17ns4v7yfk52qbf680000gn/T/pip-install-zk1urcsc/dlib/
Complete output (67 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.3 (default, Mar 27 2019, 16:54:48)
Invoking CMake setup: ‘cmake /private/var/folders/zc/mbmg3rf17ns4v7yfk52qbf680000gn/T/pip-install-zk1urcsc/dlib/tools/python -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/private/var/folders/zc/mbmg3rf17ns4v7yfk52qbf680000gn/T/pip-install-zk1urcsc/dlib/build/lib.macosx-10.7-x86_64-3.7 -DPYTHON_EXECUTABLE=/Users/bear/.virtualenvs/py3_dlib/bin/python3 -DCMAKE_BUILD_TYPE=Release’
— The C compiler identification is unknown
— The CXX compiler identification is unknown
— Check for working C compiler: /usr/bin/cc
— Check for working C compiler: /usr/bin/cc — broken
CMake Error at /usr/local/Cellar/cmake/3.15.3/share/cmake/Modules/CMakeTestCCompiler.cmake:60 (message):
The C compiler

“/usr/bin/cc”

is not able to compile a simple test program.

It fails with the following output:

Change Dir: /private/var/folders/zc/mbmg3rf17ns4v7yfk52qbf680000gn/T/pip-install-zk1urcsc/dlib/build/temp.macosx-10.7-x86_64-3.7/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/make cmTC_cc287/fast && xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun

CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:3 (project)

— Configuring incomplete, errors occurred!
See also “/private/var/folders/zc/mbmg3rf17ns4v7yfk52qbf680000gn/T/pip-install-zk1urcsc/dlib/build/temp.macosx-10.7-x86_64-3.7/CMakeFiles/CMakeOutput.log”.
See also “/private/var/folders/zc/mbmg3rf17ns4v7yfk52qbf680000gn/T/pip-install-zk1urcsc/dlib/build/temp.macosx-10.7-x86_64-3.7/CMakeFiles/CMakeError.log”.
Traceback (most recent call last):
File “”, line 1, in
File “/private/var/folders/zc/mbmg3rf17ns4v7yfk52qbf680000gn/T/pip-install-zk1urcsc/dlib/setup.py”, line 261, in
‘Topic :: Software Development’,
File “/Users/bear/.virtualenvs/py3_dlib/lib/python3.7/site-packages/setuptools/__init__.py”, line 145, in setup
return distutils.core.setup(**attrs)
File “/anaconda3/lib/python3.7/distutils/core.py”, line 148, in setup
dist.run_commands()
File “/anaconda3/lib/python3.7/distutils/dist.py”, line 966, in run_commands
self.run_command(cmd)
File “/anaconda3/lib/python3.7/distutils/dist.py”, line 985, in run_command
cmd_obj.run()
File “/Users/bear/.virtualenvs/py3_dlib/lib/python3.7/site-packages/wheel/bdist_wheel.py”, line 192, in run
self.run_command(‘build’)
File “/anaconda3/lib/python3.7/distutils/cmd.py”, line 313, in run_command
self.distribution.run_command(command)
File “/anaconda3/lib/python3.7/distutils/dist.py”, line 985, in run_command
cmd_obj.run()
File “/anaconda3/lib/python3.7/distutils/command/build.py”, line 135, in run
self.run_command(cmd_name)
File “/anaconda3/lib/python3.7/distutils/cmd.py”, line 313, in run_command
self.distribution.run_command(command)
File “/anaconda3/lib/python3.7/distutils/dist.py”, line 985, in run_command
cmd_obj.run()
File “/private/var/folders/zc/mbmg3rf17ns4v7yfk52qbf680000gn/T/pip-install-zk1urcsc/dlib/setup.py”, line 135, in run
self.build_extension(ext)
File “/private/var/folders/zc/mbmg3rf17ns4v7yfk52qbf680000gn/T/pip-install-zk1urcsc/dlib/setup.py”, line 172, in build_extension
subprocess.check_call(cmake_setup, cwd=build_folder)
File “/anaconda3/lib/python3.7/subprocess.py”, line 347, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command ‘[‘cmake’, ‘/private/var/folders/zc/mbmg3rf17ns4v7yfk52qbf680000gn/T/pip-install-zk1urcsc/dlib/tools/python’, ‘-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/private/var/folders/zc/mbmg3rf17ns4v7yfk52qbf680000gn/T/pip-install-zk1urcsc/dlib/build/lib.macosx-10.7-x86_64-3.7’, ‘-DPYTHON_EXECUTABLE=/Users/bear/.virtualenvs/py3_dlib/bin/python3’, ‘-DCMAKE_BUILD_TYPE=Release’]’ 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: /Users/bear/.virtualenvs/py3_dlib/bin/python3 -u -c ‘import sys, setuptools, tokenize; sys.argv[0] = ‘”‘”‘/private/var/folders/zc/mbmg3rf17ns4v7yfk52qbf680000gn/T/pip-install-zk1urcsc/dlib/setup.py'”‘”‘; __file__='”‘”‘/private/var/folders/zc/mbmg3rf17ns4v7yfk52qbf680000gn/T/pip-install-zk1urcsc/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 /private/var/folders/zc/mbmg3rf17ns4v7yfk52qbf680000gn/T/pip-record-wwx0654z/install-record.txt –single-version-externally-managed –compile –install-headers /Users/bear/.virtualenvs/py3_dlib/include/site/python3.7/dlib
cwd: /private/var/folders/zc/mbmg3rf17ns4v7yfk52qbf680000gn/T/pip-install-zk1urcsc/dlib/
Complete output (69 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.3 (default, Mar 27 2019, 16:54:48)
Invoking CMake setup: ‘cmake /private/var/folders/zc/mbmg3rf17ns4v7yfk52qbf680000gn/T/pip-install-zk1urcsc/dlib/tools/python -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/private/var/folders/zc/mbmg3rf17ns4v7yfk52qbf680000gn/T/pip-install-zk1urcsc/dlib/build/lib.macosx-10.7-x86_64-3.7 -DPYTHON_EXECUTABLE=/Users/bear/.virtualenvs/py3_dlib/bin/python3 -DCMAKE_BUILD_TYPE=Release’
— The C compiler identification is unknown
— The CXX compiler identification is unknown
— Check for working C compiler: /usr/bin/cc
— Check for working C compiler: /usr/bin/cc — broken
CMake Error at /usr/local/Cellar/cmake/3.15.3/share/cmake/Modules/CMakeTestCCompiler.cmake:60 (message):
The C compiler

“/usr/bin/cc”

is not able to compile a simple test program.

It fails with the following output:

Change Dir: /private/var/folders/zc/mbmg3rf17ns4v7yfk52qbf680000gn/T/pip-install-zk1urcsc/dlib/build/temp.macosx-10.7-x86_64-3.7/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/make cmTC_648b7/fast && xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun

CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:3 (project)

— Configuring incomplete, errors occurred!
See also “/private/var/folders/zc/mbmg3rf17ns4v7yfk52qbf680000gn/T/pip-install-zk1urcsc/dlib/build/temp.macosx-10.7-x86_64-3.7/CMakeFiles/CMakeOutput.log”.
See also “/private/var/folders/zc/mbmg3rf17ns4v7yfk52qbf680000gn/T/pip-install-zk1urcsc/dlib/build/temp.macosx-10.7-x86_64-3.7/CMakeFiles/CMakeError.log”.
Traceback (most recent call last):
File “”, line 1, in
File “/private/var/folders/zc/mbmg3rf17ns4v7yfk52qbf680000gn/T/pip-install-zk1urcsc/dlib/setup.py”, line 261, in
‘Topic :: Software Development’,
File “/Users/bear/.virtualenvs/py3_dlib/lib/python3.7/site-packages/setuptools/__init__.py”, line 145, in setup
return distutils.core.setup(**attrs)
File “/anaconda3/lib/python3.7/distutils/core.py”, line 148, in setup
dist.run_commands()
File “/anaconda3/lib/python3.7/distutils/dist.py”, line 966, in run_commands
self.run_command(cmd)
File “/anaconda3/lib/python3.7/distutils/dist.py”, line 985, in run_command
cmd_obj.run()
File “/Users/bear/.virtualenvs/py3_dlib/lib/python3.7/site-packages/setuptools/command/install.py”, line 61, in run
return orig.install.run(self)
File “/anaconda3/lib/python3.7/distutils/command/install.py”, line 545, in run
self.run_command(‘build’)
File “/anaconda3/lib/python3.7/distutils/cmd.py”, line 313, in run_command
self.distribution.run_command(command)
File “/anaconda3/lib/python3.7/distutils/dist.py”, line 985, in run_command
cmd_obj.run()
File “/anaconda3/lib/python3.7/distutils/command/build.py”, line 135, in run
self.run_command(cmd_name)
File “/anaconda3/lib/python3.7/distutils/cmd.py”, line 313, in run_command
self.distribution.run_command(command)
File “/anaconda3/lib/python3.7/distutils/dist.py”, line 985, in run_command
cmd_obj.run()
File “/private/var/folders/zc/mbmg3rf17ns4v7yfk52qbf680000gn/T/pip-install-zk1urcsc/dlib/setup.py”, line 135, in run
self.build_extension(ext)
File “/private/var/folders/zc/mbmg3rf17ns4v7yfk52qbf680000gn/T/pip-install-zk1urcsc/dlib/setup.py”, line 172, in build_extension
subprocess.check_call(cmake_setup, cwd=build_folder)
File “/anaconda3/lib/python3.7/subprocess.py”, line 347, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command ‘[‘cmake’, ‘/private/var/folders/zc/mbmg3rf17ns4v7yfk52qbf680000gn/T/pip-install-zk1urcsc/dlib/tools/python’, ‘-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/private/var/folders/zc/mbmg3rf17ns4v7yfk52qbf680000gn/T/pip-install-zk1urcsc/dlib/build/lib.macosx-10.7-x86_64-3.7’, ‘-DPYTHON_EXECUTABLE=/Users/bear/.virtualenvs/py3_dlib/bin/python3’, ‘-DCMAKE_BUILD_TYPE=Release’]’ returned non-zero exit status 1.
—————————————-
ERROR: Command errored out with exit status 1: /Users/bear/.virtualenvs/py3_dlib/bin/python3 -u -c ‘import sys, setuptools, tokenize; sys.argv[0] = ‘”‘”‘/private/var/folders/zc/mbmg3rf17ns4v7yfk52qbf680000gn/T/pip-install-zk1urcsc/dlib/setup.py'”‘”‘; __file__='”‘”‘/private/var/folders/zc/mbmg3rf17ns4v7yfk52qbf680000gn/T/pip-install-zk1urcsc/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 /private/var/folders/zc/mbmg3rf17ns4v7yfk52qbf680000gn/T/pip-record-wwx0654z/install-record.txt –single-version-externally-managed –compile –install-headers /Users/bear/.virtualenvs/py3_dlib/include/site/python3.7/dlib Check the logs for full command output.
macos terminal cmake face-recognition dlib
1个回答
0
投票

尝试此链接

How can I solve Error of installation Dlib?

如果dlib版本高于dlib版本,则python 3.6至3.7.0支持dlib 19.17,这会导致numpy错误

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