인프런 영문 브랜드 로고
인프런 영문 브랜드 로고

인프런 커뮤니티 질문&답변

손봉호님의 프로필 이미지

작성한 질문수

RAG를 활용한 LLM Application 개발 (feat. LangChain)

3.2 LangChain과 Chroma를 활용한 RAG 구성

윈도우 환경 pip install langchain-chroma 오류

해결된 질문

작성

·

85

·

수정됨

0

안녕하세요

윈도우환경에서
pip install langchain-chroma 시 아래와 같은 오류가 발생하였습니다

 

chatGpt에 물어보니
Visual Studio Build Tools 2022 - "C++를 사용한 데스크탑 개발" 을
설치하면 된다고 해서 설치했는데도 같은 오류가 발생합니다

혹시 원인을 해결법을 있을까요??

(new_env) PS D:\00-git\LLMS\rag> pip install langchain-chroma

Collecting langchain-chroma

Using cached langchain_chroma-0.2.2-py3-none-any.whl.metadata (1.3 kB)

Collecting langchain-core!=0.3.0,!=0.3.1,!=0.3.10,!=0.3.11,!=0.3.12,!=0.3.13,!=0.3.14,!=0.3.2,!=0.3.3,!=0.3.4,!=0.3.5,!=0.3.6,!=0.3.7,!=0.3.8,!=0.3.9,<0.4.0,>=0.2.43 (from langchain-chroma)

Using cached langchain_core-0.3.45-py3-none-any.whl.metadata (5.9 kB)

Collecting numpy<2.0.0,>=1.26.2 (from langchain-chroma)

Using cached numpy-1.26.4.tar.gz (15.8 MB)

Installing build dependencies ... done

Getting requirements to build wheel ... done

Installing backend dependencies ... done

Preparing metadata (pyproject.toml) ... error

error: subprocess-exited-with-error

× Preparing metadata (pyproject.toml) did not run successfully.

│ exit code: 1

╰─> [12 lines of output]

+ D:\00-git\LLMS\rag\new_env\Scripts\python.exe C:\Users\son\AppData\Local\Temp\pip-install-w42pka3_\numpy_b7703e22acb64ae9bde7b4f773c9579f\vendored-meson\meson\meson.py setup C:\Users\son\AppData\Local\Temp\pip-install-w42pka3_\numpy_b7703e22acb64ae9bde7b4f773c9579f C:\Users\son\AppData\Local\Temp\pip-install-w42pka3_\numpy_b7703e22acb64ae9bde7b4f773c9579f\.mesonpy-js85t3mm -Dbuildtype=release -Db_ndebug=if-release -Db_vscrt=md --native-file=C:\Users\son\AppData\Local\Temp\pip-install-w42pka3_\numpy_b7703e22acb64ae9bde7b4f773c9579f\.mesonpy-js85t3mm\meson-python-native-file.ini

The Meson build system

Version: 1.2.99

Source dir: C:\Users\son\AppData\Local\Temp\pip-install-w42pka3_\numpy_b7703e22acb64ae9bde7b4f773c9579f

Build dir: C:\Users\son\AppData\Local\Temp\pip-install-w42pka3_\numpy_b7703e22acb64ae9bde7b4f773c9579f\.mesonpy-js85t3mm

Build type: native build

Project name: NumPy

Project version: 1.26.4

 

..\meson.build:1:0: ERROR: Compiler cl cannot compile programs.

 

A full log can be found at C:\Users\son\AppData\Local\Temp\pip-install-w42pka3_\numpy_b7703e22acb64ae9bde7b4f773c9579f\.mesonpy-js85t3mm\meson-logs\meson-log.txt

[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.

[notice] A new release of pip is available: 24.3.1 -> 25.0.1

[notice] To update, run: python.exe -m pip install --upgrade pip

error: metadata-generation-failed

× Encountered error while generating package metadata.

╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.

hint: See above for details.

(new_env) PS D:\00-git\LLMS\rag>

답변 3

0

강병진님의 프로필 이미지
강병진
지식공유자

상세하게 공유해주셔서 감사합니다! 같은 어려움을 나중에 겪으시는 분들께 많은 도움이 될 것 같습니다. 환경설정이 끝나시고 본격적으로 수강하시면서 설명이 더 필요한 부분도 질문으로 올려주세요!

0

손봉호님의 프로필 이미지
손봉호
질문자

  1. Visual Studio 개발자 명령 프롬프트에서 설치

위 방법으로 해결하였습니다

0

손봉호님의 프로필 이미지
손봉호
질문자

아래와 같은 방법으로 해결하였습니다

langchain-chroma 오류 해결

에러 메시지를 보면 numpy 패키지를 빌드하는 과정에서 Compiler cl cannot compile programs.라는 오류가 발생했습니다. 이는 C 컴파일러(MSVC)가 제대로 설치되지 않았거나 설정되지 않아서 발생하는 문제입니다.

해결 방법:

1. Microsoft C++ Build Tools 설치

LangChain과 ChromaDB 등의 패키지는 종종 C 확장 모듈을 사용하므로, Visual Studio Build Tools가 필요할 수 있습니다.

  • Microsoft C++ Build Tools 다운로드 및 설치

  • Visual Studio Installer에서 "C++ build tools" 선택

  • MSVC v142 - VS 2019 C++ x64/x86 build tools 체크

  • "Windows 10 SDK" 체크

  • 설치 후 시스템을 재부팅

2. Python 및 Pip 업그레이드

powershell

복사편집

python.exe -m pip install --upgrade pip setuptools wheel


이후 다시 시도:

powershell

복사편집

pip install langchain-chroma


3. 기존 NumPy 삭제 후 다시 설치

powershell

복사편집

pip uninstall numpy

pip install --no-cache-dir numpy


이후 다시 pip install langchain-chroma 시도.

4. CMake 및 Meson 설치

numpy가 Meson과 CMake를 사용하는 경우도 있음.

powershell

복사편집

pip install cmake meson ninja


이후 다시 pip install langchain-chroma 실행.

5. Visual Studio 개발자 명령 프롬프트에서 설치

일반 PowerShell이 아니라 "x64 Native Tools Command Prompt for VS 2019/2022"를 실행한 후:

powershell

복사편집

pip install langchain-chroma