[Python] Error "metadata-generation-failed" when installing langchain-core dependencies on...

Discussão em 'Python' iniciado por Stack, Março 29, 2025.

  1. Stack

    Stack Membro Participativo

    I'm trying to install the following packages for my FastAPI project that uses LangChain with Pinecone and Google GenAI:

    langchain-core langchain-pinecone langchain-google-genai pinecone-client


    I run the following command in my virtual environment (Python 3.13.2 on Windows):

    pip install langchain-core langchain-pinecone langchain-google-genai pinecone-client


    However, I got this error during installation:

    Collecting numpy<2.0.0,>=1.26.4 (from langchain-pinecone)
    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
    ╰─> [21 lines of output]
    + E:\chatbot\chatbot-api\venv\Scripts\python.exe C:\Users\Muhammad Yousuf\AppData\Local\Temp\pip-install-1lbujxzf\numpy_f44d3f0671e2405e937c60a811fc42f7\vendored-meson\meson\meson.py setup C:\Users\Muhammad Yousuf\AppData\Local\Temp\pip-install-1lbujxzf\numpy_f44d3f0671e2405e937c60a811fc42f7 C:\Users\Muhammad Yousuf\AppData\Local\Temp\pip-install-1lbujxzf\numpy_f44d3f0671e2405e937c60a811fc42f7\.mesonpy-vtla6bb3 -Dbuildtype=release -Db_ndebug=if-release -Db_vscrt=md --native-file=C:\Users\Muhammad Yousuf\AppData\Local\Temp\pip-install-1lbujxzf\numpy_f44d3f0671e2405e937c60a811fc42f7\.mesonpy-vtla6bb3\meson-python-native-file.ini
    The Meson build system
    Version: 1.2.99
    Source dir: C:\Users\Muhammad Yousuf\AppData\Local\Temp\pip-install-1lbujxzf\numpy_f44d3f0671e2405e937c60a811fc42f7
    Build dir: C:\Users\Muhammad Yousuf\AppData\Local\Temp\pip-install-1lbujxzf\numpy_f44d3f0671e2405e937c60a811fc42f7\.mesonpy-vtla6bb3
    Build type: native build
    Project name: NumPy
    Project version: 1.26.4
    WARNING: Failed to activate VS environment: Could not parse vswhere.exe output
    ..
    ERROR: Unknown compiler(s): [['icl'], ['cl'], ['cc'], ['gcc'], ['clang'], ['clang-cl'], ['pgcc']]
    The following exception(s) were encountered:
    Running `cl /?` gave "[WinError 2] The system cannot find the file specified"
    ...


    I've already tried upgrading pip, setuptools, and wheel, and forcing pip to use binary wheels for NumPy, but the error persists.

    How can I resolve this NumPy build issue while installing these dependencies on Windows?

    Is there a way to force pip to use precompiled binaries for NumPy when using Python 3.13.2 on Windows, or should I consider downgrading to a version (e.g., Python 3.13.2) with better support for precompiled wheels?

    Any advice or workarounds would be greatly appreciated!

    Continue reading...

Compartilhe esta Página