您的当前位置:首页正文

Cargo, the Rust package manager, is not installed or is not on PATH. --windows解决方案

2024-10-23 来源:个人技术集锦

 今天安装rust时遇到这个问题:

 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.

解决方案:https://win.rustup.rs/i686,安装该文件,并按指示操作,(回车即可);

我看站内有位博主分享的一行代码解决,但我的系统无法运行;

curl https://sh.rustup.rs -sSf | sh

后来发现这不适用windows;

 参考文案:rustup.rs - Rust 工具链安装程序

显示全文