无法在Mac OS X上安装dlib库

如何解决无法在Mac OS X上安装dlib库

我正在尝试在Mac OS X(10.15.6)上安装dlib,但没有成功。

我已经安装了Python 3.7,OpenCV 4.3,cmake,XQuarts和Xcode,并且可以在笔记本电脑上使用。非常感谢您的帮助!

以下是我不断收到的很长的错误消息!

请告知我是否可以提供更多详细信息。非常感谢!

Collecting dlib
  Using cached dlib-19.21.0.tar.gz (3.2 MB)
Building wheels for collected packages: dlib
  Building wheel for dlib (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /Users/mehipour/anaconda3/bin/python -u -c 'import sys,setuptools,tokenize; sys.argv[0] = '"'"'/private/var/folders/cg/ww2hlv_510b6y0wgfh2w425w0000gn/T/pip-install-13tc8pwi/dlib/setup.py'"'"'; __file__='"'"'/private/var/folders/cg/ww2hlv_510b6y0wgfh2w425w0000gn/T/pip-install-13tc8pwi/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/cg/ww2hlv_510b6y0wgfh2w425w0000gn/T/pip-wheel-94za5_u_
       cwd: /private/var/folders/cg/ww2hlv_510b6y0wgfh2w425w0000gn/T/pip-install-13tc8pwi/dlib/
  Complete output (79 lines):
  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
  Building extension for Python 3.7.3 (default,Mar 27 2019,16:54:48)
  Invoking CMake setup: 'cmake /private/var/folders/cg/ww2hlv_510b6y0wgfh2w425w0000gn/T/pip-install-13tc8pwi/dlib/tools/python -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/private/var/folders/cg/ww2hlv_510b6y0wgfh2w425w0000gn/T/pip-install-13tc8pwi/dlib/build/lib.macosx-10.9-x86_64-3.7 -DPYTHON_EXECUTABLE=/Users/mehipour/anaconda3/bin/python -DCMAKE_BUILD_TYPE=Release'
  -- The C compiler identification is Clang 4.0.1
  -- The CXX compiler identification is Clang 4.0.1
  -- Detecting C compiler ABI info
  -- Detecting C compiler ABI info - failed
  -- Check for working C compiler: /Users/mehipour/anaconda3/bin/x86_64-apple-darwin13.4.0-clang
  -- Check for working C compiler: /Users/mehipour/anaconda3/bin/x86_64-apple-darwin13.4.0-clang - broken
  CMake Error at /usr/local/Cellar/cmake/3.18.1/share/cmake/Modules/CMakeTestCCompiler.cmake:66 (message):
    The C compiler
  
      "/Users/mehipour/anaconda3/bin/x86_64-apple-darwin13.4.0-clang"
  
    is not able to compile a simple test program.
  
    It fails with the following output:
  
      Change Dir: /private/var/folders/cg/ww2hlv_510b6y0wgfh2w425w0000gn/T/pip-install-13tc8pwi/dlib/build/temp.macosx-10.9-x86_64-3.7/CMakeFiles/CMakeTmp
  
      Run Build Command(s):/usr/bin/make cmTC_1a32f/fast && /Library/Developer/CommandLineTools/usr/bin/make  -f CMakeFiles/cmTC_1a32f.dir/build.make CMakeFiles/cmTC_1a32f.dir/build
      Building C object CMakeFiles/cmTC_1a32f.dir/testCCompiler.c.o
      /Users/mehipour/anaconda3/bin/x86_64-apple-darwin13.4.0-clang   -march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe  -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk -o CMakeFiles/cmTC_1a32f.dir/testCCompiler.c.o -c /private/var/folders/cg/ww2hlv_510b6y0wgfh2w425w0000gn/T/pip-install-13tc8pwi/dlib/build/temp.macosx-10.9-x86_64-3.7/CMakeFiles/CMakeTmp/testCCompiler.c
      Linking C executable cmTC_1a32f
      /usr/local/Cellar/cmake/3.18.1/bin/cmake -E cmake_link_script CMakeFiles/cmTC_1a32f.dir/link.txt --verbose=1
      /Users/mehipour/anaconda3/bin/x86_64-apple-darwin13.4.0-clang -march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe  -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk -Wl,-search_paths_first -Wl,-headerpad_max_install_names -Wl,-pie -Wl,-dead_strip_dylibs  CMakeFiles/cmTC_1a32f.dir/testCCompiler.c.o -o cmTC_1a32f
      ld: warning: ignoring file /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/lib/libSystem.tbd,file was built for unsupported file format ( 0x2D 0x2D 0x2D 0x20 0x21 0x74 0x61 0x70 0x69 0x2D 0x74 0x62 0x64 0x0A 0x74 0x62 ) which is not the architecture being linked (x86_64): /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/lib/libSystem.tbd
      ld: dynamic main executables must link with libSystem.dylib for architecture x86_64
      clang-4.0: error: linker command failed with exit code 1 (use -v to see invocation)
      make[1]: *** [cmTC_1a32f] Error 1
      make: *** [cmTC_1a32f/fast] Error 2
  
  
  
  
  
    CMake will not be able to correctly generate this project.
  Call Stack (most recent call first):
    CMakeLists.txt:14 (project)
  
  
  -- Configuring incomplete,errors occurred!
  See also "/private/var/folders/cg/ww2hlv_510b6y0wgfh2w425w0000gn/T/pip-install-13tc8pwi/dlib/build/temp.macosx-10.9-x86_64-3.7/CMakeFiles/CMakeOutput.log".
  See also "/private/var/folders/cg/ww2hlv_510b6y0wgfh2w425w0000gn/T/pip-install-13tc8pwi/dlib/build/temp.macosx-10.9-x86_64-3.7/CMakeFiles/CMakeError.log".
  Traceback (most recent call last):
    File "<string>",line 1,in <module>
    File "/private/var/folders/cg/ww2hlv_510b6y0wgfh2w425w0000gn/T/pip-install-13tc8pwi/dlib/setup.py",line 262,in <module>
      'Topic :: Software Development',File "/Users/mehipour/anaconda3/lib/python3.7/site-packages/setuptools/__init__.py",line 145,in setup
      return distutils.core.setup(**attrs)
    File "/Users/mehipour/anaconda3/lib/python3.7/distutils/core.py",line 148,in setup
      dist.run_commands()
    File "/Users/mehipour/anaconda3/lib/python3.7/distutils/dist.py",line 966,in run_commands
      self.run_command(cmd)
    File "/Users/mehipour/anaconda3/lib/python3.7/distutils/dist.py",line 985,in run_command
      cmd_obj.run()
    File "/Users/mehipour/anaconda3/lib/python3.7/site-packages/wheel/bdist_wheel.py",line 192,in run
      self.run_command('build')
    File "/Users/mehipour/anaconda3/lib/python3.7/distutils/cmd.py",line 313,in run_command
      self.distribution.run_command(command)
    File "/Users/mehipour/anaconda3/lib/python3.7/distutils/dist.py",in run_command
      cmd_obj.run()
    File "/Users/mehipour/anaconda3/lib/python3.7/distutils/command/build.py",line 135,in run
      self.run_command(cmd_name)
    File "/Users/mehipour/anaconda3/lib/python3.7/distutils/cmd.py",in run_command
      cmd_obj.run()
    File "/private/var/folders/cg/ww2hlv_510b6y0wgfh2w425w0000gn/T/pip-install-13tc8pwi/dlib/setup.py",in run
      self.build_extension(ext)
    File "/private/var/folders/cg/ww2hlv_510b6y0wgfh2w425w0000gn/T/pip-install-13tc8pwi/dlib/setup.py",line 172,in build_extension
      subprocess.check_call(cmake_setup,cwd=build_folder)
    File "/Users/mehipour/anaconda3/lib/python3.7/subprocess.py",line 347,in check_call
      raise CalledProcessError(retcode,cmd)
  subprocess.CalledProcessError: Command '['cmake','/private/var/folders/cg/ww2hlv_510b6y0wgfh2w425w0000gn/T/pip-install-13tc8pwi/dlib/tools/python','-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/private/var/folders/cg/ww2hlv_510b6y0wgfh2w425w0000gn/T/pip-install-13tc8pwi/dlib/build/lib.macosx-10.9-x86_64-3.7','-DPYTHON_EXECUTABLE=/Users/mehipour/anaconda3/bin/python','-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
DEPRECATION: Could not build wheels for dlib which do not use PEP 517. pip will fall back to legacy 'setup.py install' for these. pip 21.0 will remove support for this functionality. A possible replacement is to fix the wheel build issue reported above. You can find discussion regarding this at https://github.com/pypa/pip/issues/8368.
Installing collected packages: dlib
    Running setup.py install for dlib ... error
    ERROR: Command errored out with exit status 1:
     command: /Users/mehipour/anaconda3/bin/python -u -c 'import sys,'"'"'exec'"'"'))' install --record /private/var/folders/cg/ww2hlv_510b6y0wgfh2w425w0000gn/T/pip-record-04q_e2mw/install-record.txt --single-version-externally-managed --compile --install-headers /Users/mehipour/anaconda3/include/python3.7m/dlib
         cwd: /private/var/folders/cg/ww2hlv_510b6y0wgfh2w425w0000gn/T/pip-install-13tc8pwi/dlib/
    Complete output (81 lines):
    running install
    running build
    running build_py
    package init file 'tools/python/dlib/__init__.py' not found (or not a regular file)
    running build_ext
    Building extension for Python 3.7.3 (default,16:54:48)
    Invoking CMake setup: 'cmake /private/var/folders/cg/ww2hlv_510b6y0wgfh2w425w0000gn/T/pip-install-13tc8pwi/dlib/tools/python -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/private/var/folders/cg/ww2hlv_510b6y0wgfh2w425w0000gn/T/pip-install-13tc8pwi/dlib/build/lib.macosx-10.9-x86_64-3.7 -DPYTHON_EXECUTABLE=/Users/mehipour/anaconda3/bin/python -DCMAKE_BUILD_TYPE=Release'
    -- The C compiler identification is Clang 4.0.1
    -- The CXX compiler identification is Clang 4.0.1
    -- Detecting C compiler ABI info
    -- Detecting C compiler ABI info - failed
    -- Check for working C compiler: /Users/mehipour/anaconda3/bin/x86_64-apple-darwin13.4.0-clang
    -- Check for working C compiler: /Users/mehipour/anaconda3/bin/x86_64-apple-darwin13.4.0-clang - broken
    CMake Error at /usr/local/Cellar/cmake/3.18.1/share/cmake/Modules/CMakeTestCCompiler.cmake:66 (message):
      The C compiler
    
        "/Users/mehipour/anaconda3/bin/x86_64-apple-darwin13.4.0-clang"
    
      is not able to compile a simple test program.
    
      It fails with the following output:
    
        Change Dir: /private/var/folders/cg/ww2hlv_510b6y0wgfh2w425w0000gn/T/pip-install-13tc8pwi/dlib/build/temp.macosx-10.9-x86_64-3.7/CMakeFiles/CMakeTmp
    
        Run Build Command(s):/usr/bin/make cmTC_76b3f/fast && /Library/Developer/CommandLineTools/usr/bin/make  -f CMakeFiles/cmTC_76b3f.dir/build.make CMakeFiles/cmTC_76b3f.dir/build
        Building C object CMakeFiles/cmTC_76b3f.dir/testCCompiler.c.o
        /Users/mehipour/anaconda3/bin/x86_64-apple-darwin13.4.0-clang   -march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe  -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk -o CMakeFiles/cmTC_76b3f.dir/testCCompiler.c.o -c /private/var/folders/cg/ww2hlv_510b6y0wgfh2w425w0000gn/T/pip-install-13tc8pwi/dlib/build/temp.macosx-10.9-x86_64-3.7/CMakeFiles/CMakeTmp/testCCompiler.c
        Linking C executable cmTC_76b3f
        /usr/local/Cellar/cmake/3.18.1/bin/cmake -E cmake_link_script CMakeFiles/cmTC_76b3f.dir/link.txt --verbose=1
        /Users/mehipour/anaconda3/bin/x86_64-apple-darwin13.4.0-clang -march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe  -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk -Wl,-dead_strip_dylibs  CMakeFiles/cmTC_76b3f.dir/testCCompiler.c.o -o cmTC_76b3f
        ld: warning: ignoring file /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/lib/libSystem.tbd,file was built for unsupported file format ( 0x2D 0x2D 0x2D 0x20 0x21 0x74 0x61 0x70 0x69 0x2D 0x74 0x62 0x64 0x0A 0x74 0x62 ) which is not the architecture being linked (x86_64): /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/lib/libSystem.tbd
        ld: dynamic main executables must link with libSystem.dylib for architecture x86_64
        clang-4.0: error: linker command failed with exit code 1 (use -v to see invocation)
        make[1]: *** [cmTC_76b3f] Error 1
        make: *** [cmTC_76b3f/fast] Error 2
    
    
    
    
    
      CMake will not be able to correctly generate this project.
    Call Stack (most recent call first):
      CMakeLists.txt:14 (project)
    
    
    -- Configuring incomplete,errors occurred!
    See also "/private/var/folders/cg/ww2hlv_510b6y0wgfh2w425w0000gn/T/pip-install-13tc8pwi/dlib/build/temp.macosx-10.9-x86_64-3.7/CMakeFiles/CMakeOutput.log".
    See also "/private/var/folders/cg/ww2hlv_510b6y0wgfh2w425w0000gn/T/pip-install-13tc8pwi/dlib/build/temp.macosx-10.9-x86_64-3.7/CMakeFiles/CMakeError.log".
    Traceback (most recent call last):
      File "<string>",in <module>
      File "/private/var/folders/cg/ww2hlv_510b6y0wgfh2w425w0000gn/T/pip-install-13tc8pwi/dlib/setup.py",in <module>
        'Topic :: Software Development',in setup
        return distutils.core.setup(**attrs)
      File "/Users/mehipour/anaconda3/lib/python3.7/distutils/core.py",in setup
        dist.run_commands()
      File "/Users/mehipour/anaconda3/lib/python3.7/distutils/dist.py",in run_commands
        self.run_command(cmd)
      File "/Users/mehipour/anaconda3/lib/python3.7/distutils/dist.py",in run_command
        cmd_obj.run()
      File "/Users/mehipour/anaconda3/lib/python3.7/site-packages/setuptools/command/install.py",line 61,in run
        return orig.install.run(self)
      File "/Users/mehipour/anaconda3/lib/python3.7/distutils/command/install.py",line 545,in run
        self.run_command('build')
      File "/Users/mehipour/anaconda3/lib/python3.7/distutils/cmd.py",in run_command
        self.distribution.run_command(command)
      File "/Users/mehipour/anaconda3/lib/python3.7/distutils/dist.py",in run_command
        cmd_obj.run()
      File "/Users/mehipour/anaconda3/lib/python3.7/distutils/command/build.py",in run
        self.run_command(cmd_name)
      File "/Users/mehipour/anaconda3/lib/python3.7/distutils/cmd.py",in run_command
        cmd_obj.run()
      File "/private/var/folders/cg/ww2hlv_510b6y0wgfh2w425w0000gn/T/pip-install-13tc8pwi/dlib/setup.py",in run
        self.build_extension(ext)
      File "/private/var/folders/cg/ww2hlv_510b6y0wgfh2w425w0000gn/T/pip-install-13tc8pwi/dlib/setup.py",in build_extension
        subprocess.check_call(cmake_setup,cwd=build_folder)
      File "/Users/mehipour/anaconda3/lib/python3.7/subprocess.py",in check_call
        raise CalledProcessError(retcode,cmd)
    subprocess.CalledProcessError: Command '['cmake','-DCMAKE_BUILD_TYPE=Release']' returned non-zero exit status 1.
    ----------------------------------------
ERROR: Command errored out with exit status 1: /Users/mehipour/anaconda3/bin/python -u -c 'import sys,'"'"'exec'"'"'))' install --record /private/var/folders/cg/ww2hlv_510b6y0wgfh2w425w0000gn/T/pip-record-04q_e2mw/install-record.txt --single-version-externally-managed --compile --install-headers /Users/mehipour/anaconda3/include/python3.7m/dlib Check the logs for full command output.

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐


依赖报错 idea导入项目后依赖报错,解决方案:https://blog.csdn.net/weixin_42420249/article/details/81191861 依赖版本报错:更换其他版本 无法下载依赖可参考:https://blog.csdn.net/weixin_42628809/a
错误1:代码生成器依赖和mybatis依赖冲突 启动项目时报错如下 2021-12-03 13:33:33.927 ERROR 7228 [ main] o.s.b.d.LoggingFailureAnalysisReporter : *************************** APPL
错误1:gradle项目控制台输出为乱码 # 解决方案:https://blog.csdn.net/weixin_43501566/article/details/112482302 # 在gradle-wrapper.properties 添加以下内容 org.gradle.jvmargs=-Df
错误还原:在查询的过程中,传入的workType为0时,该条件不起作用 &lt;select id=&quot;xxx&quot;&gt; SELECT di.id, di.name, di.work_type, di.updated... &lt;where&gt; &lt;if test=&qu
报错如下,gcc版本太低 ^ server.c:5346:31: 错误:‘struct redisServer’没有名为‘server_cpulist’的成员 redisSetCpuAffinity(server.server_cpulist); ^ server.c: 在函数‘hasActiveC
解决方案1 1、改项目中.idea/workspace.xml配置文件,增加dynamic.classpath参数 2、搜索PropertiesComponent,添加如下 &lt;property name=&quot;dynamic.classpath&quot; value=&quot;tru
删除根组件app.vue中的默认代码后报错:Module Error (from ./node_modules/eslint-loader/index.js): 解决方案:关闭ESlint代码检测,在项目根目录创建vue.config.js,在文件中添加 module.exports = { lin
查看spark默认的python版本 [root@master day27]# pyspark /home/software/spark-2.3.4-bin-hadoop2.7/conf/spark-env.sh: line 2: /usr/local/hadoop/bin/hadoop: No s
使用本地python环境可以成功执行 import pandas as pd import matplotlib.pyplot as plt # 设置字体 plt.rcParams[&#39;font.sans-serif&#39;] = [&#39;SimHei&#39;] # 能正确显示负号 p
错误1:Request method ‘DELETE‘ not supported 错误还原:controller层有一个接口,访问该接口时报错:Request method ‘DELETE‘ not supported 错误原因:没有接收到前端传入的参数,修改为如下 参考 错误2:cannot r
错误1:启动docker镜像时报错:Error response from daemon: driver failed programming external connectivity on endpoint quirky_allen 解决方法:重启docker -&gt; systemctl r
错误1:private field ‘xxx‘ is never assigned 按Altʾnter快捷键,选择第2项 参考:https://blog.csdn.net/shi_hong_fei_hei/article/details/88814070 错误2:启动时报错,不能找到主启动类 #
报错如下,通过源不能下载,最后警告pip需升级版本 Requirement already satisfied: pip in c:\users\ychen\appdata\local\programs\python\python310\lib\site-packages (22.0.4) Coll
错误1:maven打包报错 错误还原:使用maven打包项目时报错如下 [ERROR] Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:3.2.0:resources (default-resources)
错误1:服务调用时报错 服务消费者模块assess通过openFeign调用服务提供者模块hires 如下为服务提供者模块hires的控制层接口 @RestController @RequestMapping(&quot;/hires&quot;) public class FeignControl
错误1:运行项目后报如下错误 解决方案 报错2:Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project sb 解决方案:在pom.
参考 错误原因 过滤器或拦截器在生效时,redisTemplate还没有注入 解决方案:在注入容器时就生效 @Component //项目运行时就注入Spring容器 public class RedisBean { @Resource private RedisTemplate&lt;String
使用vite构建项目报错 C:\Users\ychen\work&gt;npm init @vitejs/app @vitejs/create-app is deprecated, use npm init vite instead C:\Users\ychen\AppData\Local\npm-