gpt4 book ai didi

windows - 无法安装 cargo-tree : couldn't determine visual studio generator

转载 作者:可可西里 更新时间:2023-11-01 10:41:48 29 4
gpt4 key购买 nike

我正在尝试在我的 Windows 机器上安装 cargo-tree。它使用 Windows 10,Visual Studio 构建工具 15。这是我活跃的 rustup 工具链:

active toolchain
----------------

stable-x86_64-pc-windows-msvc (default)
rustc 1.26.0 (a77568041 2018-05-07)

运行 cargo install cargo-tree 时,构建失败。构建日志以以下结尾:

error: failed to run custom build command for `libssh2-sys v0.2.7`
process didn't exit successfully: `C:\Users\NICOLA~1\AppData\Local\Temp\cargo-installt7F5FM\release\build\libssh2-sys-726b9e90a2ed2b95\build-script-build` (exit code: 101)
--- stderr
fatal: not a git repository (or any of the parent directories): .git
thread 'main' panicked at '

couldn't determine visual studio generator
if VisualStudio is installed, however, consider running the appropriate vcvars script before building this crate
', C:\Users\nicolas-delsaux\.cargo\registry\src\github.com-1ecc6299db9ec823\cmake-0.1.31\src\lib.rs:552:25
note: Run with `RUST_BACKTRACE=1` for a backtrace.

warning: build failed, waiting for other jobs to finish...
error: failed to compile `cargo-tree v0.18.0`, intermediate artifacts can be found at `C:\Users\NICOLA~1\AppData\Local\Temp\cargo-installt7F5FM`

根据我在网上找到的一些文档,它似乎与要调用的一些 vcvars 脚本以及要安装的旧版 Visual Studio 相关。我不完全明白该怎么做

  • 我应该安装旧版本的 Visual Studio 吗?
  • 我有一些要运行的脚本吗?

最佳答案

根据@user25064,这需要通过开发人员命令提示符安装命令(更具体地说,您的架构的开发人员命令提示符 - 注意 x86/x64 架构)

关于windows - 无法安装 cargo-tree : couldn't determine visual studio generator,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50749050/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com