安装Jupyter Notebook 之不断报错 差点放弃版

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.

报错内容如上。

我是windows电脑。

上面报错 其实是缺少 Rust。

Windows 用户
  1. 下载并运行 rustup-init.exe

    • 从官网下载:https://rustup.rs 或直接下载 rustup-init.exe

    • 双击运行,在弹出的命令行窗口中:

      • 按 回车 选择默认安装。

      • 输入 1 并回车,确认安装。

      • 其实安装后是安装Microsoft Visual Studio。安装后最好重启电脑。

      • 安装 Rust 后仍报错

        • 确保关闭所有 CMD/PowerShell 窗口后重新打开,让环境变量生效。

        • 运行 rustup update 更新 Rust 工具链。

      • 网络问题

        • 使用国内镜像加速 Rust 安装:

          cmd

          复制

          下载

          set RUSTUP_DIST_SERVER=https://mirrors.ustc.edu.cn/rust-static
          set RUSTUP_UPDATE_ROOT=https://mirrors.ustc.edu.cn/rust-static/rustup
      • 所以需要再次运行一次 rustup-init.exe

      • 这时候cmd运行下面命令 发现有了就OK了。

        rustc --version
        cargo --version
      • 再次 pip install notebook 即可
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值