본문 바로가기
Issue

HuggingFace) ERROR: Failed to build installable wheels for some pyproject.toml based projects

by 박채니 2024. 8. 30.
SMALL

안녕하세요, 코린이의 코딩 학습기 채니 입니다.
개인 포스팅용으로 내용에 오류 및 잘못된 정보가 있을 수 있습니다.

# 상황

HuggingFace에서 사전 학습된 모델을 가져와 프로젝트를 하나 만들려고 했다.

https://huggingface.co/TencentARC/PhotoMaker

 

TencentARC/PhotoMaker · Hugging Face

PhotoMaker Model Card Introduction Users can input one or a few face photos, along with a text prompt, to receive a customized photo or painting within seconds (no training required!). Additionally, this model can be adapted to any base model based on SDXL

huggingface.co

위 모델을 사용하려고 하고, 간단하게 말하자면 첨부한 이미지와 프롬프트를 참고하여 새로운 이미지를 생성해준다.

Github에 sample을 따라 실행 중 insightface 설치 관련하여 오류가 발생했다.

requirements.txt

torch
torchvision
diffusers
transformers
huggingface-hub
spaces
numpy
accelerate
safetensors
omegaconf
peft
gradio
insightface==0.7.3

🐛 오류 메세지

$ pip install -r requirements.txt

...
...
clang++ -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Iinsightface/thirdparty/face3d/mesh/cython -I/opt/homebrew/Cellar/python@3.11/3.11.7/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/numpy/core/include -I/opt/homebrew/opt/python@3.11/Frameworks/Python.framework/Versions/3.11/include/python3.11 -c insightface/thirdparty/face3d/mesh/cython/mesh_core.cpp -o build/temp.macosx-13-arm64-cpython-311/insightface/thirdparty/face3d/mesh/cython/mesh_core.o
      xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
      error: command '/usr/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
Failed to build insightface
ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (insightface

💡 해결방안

$ xcode-select --install

🔥 원인

Command Line Tools가 올바르게 설치되어 있지 않아 발생한 오류였고, Command Line Tool를 설치하여 오류를 처리해주었다.
만일 xcode-select가 설치되어 있는데도 해당 오류가 발생한다면, 아래 명령어를 입력해주면 된다!

$ sudo xcode-select --reset

 

참고 사이트

https://github.com/cubiq/ComfyUI_IPAdapter_plus/issues/259

 

Error occurred when executing InsightFaceLoader: Unable to import dependency onnxruntime. · Issue #259 · cubiq/ComfyUI_IPAdapt

File "C:\Users\muhdi\OneDrive\Documents\ai\ComfyUI_windows_portable\ComfyUI\execution.py", line 152, in recursive_execute output_data, output_ui = get_output_data(obj, input_data_all) ^^^^^^^^^^^^^...

github.com

 

 

 

LIST