pip install insightface error(apple m2)

错误:

 In file included from insightface/thirdparty/face3d/mesh/cython/mesh_core.cpp:11:
      In file included from insightface/thirdparty/face3d/mesh/cython/mesh_core.h:6:
      In file included from /opt/homebrew/opt/llvm@16/bin/../include/c++/v1/algorithm:1747:
      In file included from /opt/homebrew/opt/llvm@16/bin/../include/c++/v1/__algorithm/inplace_merge.h:27:
      In file included from /opt/homebrew/opt/llvm@16/bin/../include/c++/v1/__memory/temporary_buffer.h:17:
      In file included from /opt/homebrew/opt/llvm@16/bin/../include/c++/v1/new:97:
      /opt/homebrew/opt/llvm@16/bin/../include/c++/v1/exception:199:55: error: expected ';' at end of declaration list
          _LIBCPP_INLINE_VISIBILITY exception_ptr(nullptr_t) _NOEXCEPT : __ptr_() {}
                                                            ^
      fatal error: too many errors emitted, stopping now [-ferror-limit=]
      13 warnings and 20 errors generated.
      error: command '/opt/homebrew/opt/llvm@16/bin/clang' failed with exit code 1
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for insightface

解决方法:

xcode-select -p
export SDKROOT=$(xcrun --sdk macosx --show-sdk-path)
pip install protobuf==3.20.3 // 如果有报错说 protobuf 版本与冲突就执行这句
pip install insightface
posted @ 2024-02-20 12:36  nenhall/浩哥哥  阅读(109)  评论(0编辑  收藏  举报