最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

python - Error "metadata-generation-failed" when installing langchain-core dependencies on Windows (NumPy buil

programmeradmin0浏览0评论

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!

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!

Share Improve this question edited Mar 30 at 0:58 jared 9,2213 gold badges15 silver badges43 bronze badges asked Mar 29 at 17:54 Muhammad YousafMuhammad Yousaf 13 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 1

According to the release notes, Numpy 1.26.4 doesn't support Python 3.13, so yes, if you need version 1.x.y (which at least one of your other libraries seems to be requiring), you should downgrade to Python 3.12.

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论