我刚刚尝试在我的 pip venv 上安装 openai,但返回了此错误。
我以前从未见过这个错误。我的 pip 是最新的,我尝试了 2 个不同的环境。
我输入的命令是:
pip 安装 openai
我想使用 pip 安装 openai api,但收到了一个不寻常的错误。任何人都可以帮助我解决这个问题或有想法如何解决这个问题吗? 非常感谢。
错误信息:
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... error
error: subprocess-exited-with-error
× Preparing metadata (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [6 lines of output]
Cargo, the Rust package manager, is not installed or is not on PATH.
This package requires Rust and Cargo to compile extensions. Install it through
the system's package manager or via https://rustup.rs/
Checking for Rust toolchain....
[end of output]
note: This error originates from a subprocess, and is likely not a problem with 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.```
您的错误消息非常具有描述性,它为您的问题提供了解决方案:
Cargo, the Rust package manager, is not installed or is not on PATH.
openai 包需要 Rust 和 Cargo 来编译扩展。您可以通过系统的包管理器或通过https://rustup.rs/安装它。