Python/Debugging

Mac OS에서 insightface 모듈 설치 실패 해결 방법

jimmy_AI 2025. 4. 15. 00:31
반응형

안녕하세요.

이번 시간에는 Mac OS 환경에서 insightface 모듈 설치가 실패하는 현상에 대하여

해결 방법을 간략하게 다루어보도록 하겠습니다.

 

 

오류 개요

맥 환경에서 pip install insightface 명령어를 통하여 모듈 설치를 진행하던 도중, 

다음과 같은 오류가 발생하면서 설치에 실패하였습니다.

× Failed to build insightface==0.7.3
└─▶ Call to setuptools.build_meta.build_wheel failed (exit status: 1)

[stdout]
WARNING: pandoc not enabled
running bdist_wheel
running build
running build_py
...
running egg_info
writing insightface.egg-info/PKG-INFO
writing dependency_links to insightface.egg-info/dependency_links.txt
writing entry points to insightface.egg-info/entry_points.txt
writing requirements to insightface.egg-info/requires.txt
writing top-level names to insightface.egg-info/top_level.txt
reading manifest file 'insightface.egg-info/SOURCES.txt'
writing manifest file 'insightface.egg-info/SOURCES.txt'
...
running build_ext
building 'insightface.thirdparty.face3d.mesh.cython.mesh_core_cython' extension
c++ ... -arch arm64 -mmacosx-version-min=11.0 ... -Iinsightface/thirdparty/face3d/mesh/cython ... -c insightface/thirdparty/face3d/mesh/cython/mesh_core.cpp -o ...
 
[stderr]
/.../setuptools/command/build_py.py:212: _Warning: Package 'insightface.data.images' is absent from the packages configuration.
   ...
/.../setuptools/command/build_py.py:212: _Warning: Package 'insightface.data.objects' is absent from the packages configuration.
   ...
/.../setuptools/command/build_py.py:212: _Warning: Package 'insightface.thirdparty.face3d.mesh.cython' is absent from the packages configuration.
   ...
In file included from insightface/thirdparty/face3d/mesh/cython/mesh_core.cpp:11:
insightface/thirdparty/face3d/mesh/cython/mesh_core.h:5:10: fatal error: 'cmath' file not found
    #include <cmath>
             ^~~~~~~
1 error generated.
error: command '/usr/bin/c++' failed with exit code 1

hint: This usually indicates a problem with the package or the build environment.

 

 

해결 방법

다음과 같은 방법을 통하여 위에서 다룬 설치 실패 현상을 해결할 수 있었습니다.

# 1. xcode 설치
xcode-select --install

# 2. xcode 설치 확인
xcode-select -p

# 3. 필요한 패키지 설치
brew install llvm libomp

# 4. default 컴파일러 지정
export CC=$(brew --prefix llvm)/bin/clang
export CXX=$(brew --prefix llvm)/bin/clang++

# 5. 모듈 재설치 시도
pip install insightface

 

이 글이 Mac OS에서 insightface 모듈 설치 문제 해결에 도움이 되셨기를 바라겠습니다.

잘 봐주셔서 감사합니다.