반응형
langchain 설치 (pip install langchain) 중에 아래와 같은 에러 발생
 
Error Message:
 
In file included from src/greenlet/greenlet.cpp:9:      /Library/Developer/CommandLineTools/SDKs/MacOSX13.3.sdk/usr/include/c++/v1/cstdlib:135:9: error: no member named 'at_quick_exit' in the global namespace      using ::at_quick_exit _LIBCPP_USING_IF_EXISTS;            ~~^      /Library/Developer/CommandLineTools/SDKs/MacOSX13.3.sdk/usr/include/c++/v1/cstdlib:136:9: error: no member named 'quick_exit' in the global namespace      using ::quick_exit _LIBCPP_USING_IF_EXISTS;            ~~^      2 errors generated.      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 greenletFailed to build greenletERROR: Could not build wheels for greenlet, which is required to install pyproject.toml-based projects(venv) $ 
 
에러 메시지의 이미지

 

에러 내용을 자세히 보면 /usr/bin/clang 과 관련해서 문제가 있다고 나와서 인터넷 검색해보니 아래와 같은 페이지가 나왔음.

How to fix Error: command ‘/usr/bin/clang’ failed with exit code 1?

 
여기서 권장하는 대로 여러가지를 upgrade하고 나니 잘 됬음.
 
1,2,3 brew install openssl re2
 
이렇게 업그레이드 하고 다시 install langchain을 하니 grpcio error가 발생했음.
그래서 잘 돌아가는 가상환경에서 grpcio의 버전을 확인해서 설치를 했으나
 
실패
 
다시 그냥 langchain을 설치하려하니 이번에는 아래 같은 에러 발생
 
  note: This error originates from a subprocess, and is likely not a problem with pip.  ERROR: Failed building wheel for greenletFailed to build greenletERROR: Could not build wheels for greenlet, which is required to install pyproject.toml-based projects
 
내용을 뜯어 보니 greenlet이 문제 인 것 같아서..
다시 잘 돌아가는 가상 환경에서 greenlet이 있는지 찾아보고 같은 버전으로 설치
 
이런 젠장, 그래도 안되서 인터넷을 찾아보니 아래 명령을 실행하라고...
 
pip install --only-binary :all: greenlet
 
이렇게 하는 이유를 아래와 같이 설명하고 있는데..
 
Python packages are often distributed as "wheels" (.whl files), which are pre-compiled binary packages. Try installing "greenlet" and "Flask-SQLAlchemy" using wheels instead of source distribution`
 
이말을 풀어보면, 소스 배포형태에서 wheels 를 사용해서 설치하지말고 pre-compiled된 바이너리 패키지를 이용해서 설치하니까 잘 되더라 라는 의미임.
 
음.... 그러니까 소스를 가져다가 컴파일해서 쓰러면 컴피일과 관련 라이브러리, 경로 환경 등 여러가지가 맞아야 설치가 되는 데....바이너리 패키지를 설치하면 이런 복잡한 것 필요없이 쉽게 설치가 되더라 라는 의미로 이해됨.
 
이러고 나서 langchain을 설치하니까 잘 설치됨.
 
즉, 아래 명령 실행 후 langchain을 설치 했음.
pip install --only-binary :all: greenlet
 
 
 
 
 
반응형

+ Recent posts