rust官方地址
使用pycharm下载安装器
curl https://sh.rustup.rs -sSf | sh
(mlcllm) C:\Users\Administrator\Desktop\mlc-llm-main\mlc-llm>curl https://sh.rustup.rs -sSf | sh
info: downloading installer
Warning: Not enforcing strong cipher suites for TLS, this is potentially less secure
Welcome to Rust!
The Cargo home directory is located at:
C:\Users\Administrator\.cargo
This can be modified with the CARGO_HOME environment variable.
The cargo, rustc, rustup and other commands will be added to
Cargo's bin directory, located at:
C:\Users\Administrator\.cargo\bin
This path will then be added to your PATH environment variable by
modifying the HKEY_CURRENT_USER/Environment/PATH registry key.
You can uninstall at any time with rustup self uninstall and
these changes will be reverted.
Current installation options:
default host triple: x86_64-pc-windows-msvc
default toolchain: stable (default)
profile: default
modify PATH variable: yes
1) Proceed with standard installation (default - just press enter)
2) Customize installation
3) Cancel installation
安装选项,选择一个(1)默认安装选项
Current installation options:
default host triple: x86_64-pc-windows-msvc
default toolchain: stable (default)
profile: default
modify PATH variable: yes
1) Proceed with standard installation (default - just press enter)
2) Customize installation
3) Cancel installation
输入1
, 回车继续执行
屏幕上出现 Rust is installed now. Great!
说明安装成功
Current installation options:
default host triple: x86_64-pc-windows-msvc
default toolchain: stable (default)
profile: default
modify PATH variable: yes
1) Proceed with standard installation (default - just press enter)
2) Customize installation
3) Cancel installation
>1
info: profile set to 'default'
info: default host triple is x86_64-pc-windows-msvc
info: syncing channel updates for 'stable-x86_64-pc-windows-msvc'
821.1 KiB / 821.1 KiB (100 %) 44.8 KiB/s in 21s ETA: 0s
info: latest update on 2025-01-09, rust version 1.84.0 (9fc6b4312 2025-01-07)
info: downloading component 'cargo'
6.9 MiB / 6.9 MiB (100 %) 35.2 KiB/s in 4m 25s ETA: 0s
info: downloading component 'clippy'
2.6 MiB / 2.6 MiB (100 %) 32.0 KiB/s in 1m 28s ETA: 0s
info: downloading component 'rust-docs'
16.5 MiB / 16.5 MiB (100 %) 44.8 KiB/s in 11m 24s ETA: 0s
info: downloading component 'rust-std'
22.2 MiB / 22.2 MiB (100 %) 32.0 KiB/s in 14m 37s ETA: 0s
info: downloading component 'rustc'
63.9 MiB / 63.9 MiB (100 %) 1.3 MiB/s in 3m 33s ETA: 0s
info: downloading component 'rustfmt'
1.7 MiB / 1.7 MiB (100 %) 1.5 MiB/s in 1s ETA: 0s
info: installing component 'cargo'
info: installing component 'clippy'
info: installing component 'rust-docs'
16.5 MiB / 16.5 MiB (100 %) 3.0 MiB/s in 3s ETA: 0s
info: installing component 'rust-std'
22.2 MiB / 22.2 MiB (100 %) 20.2 MiB/s in 1s ETA: 0s
info: installing component 'rustc'
63.9 MiB / 63.9 MiB (100 %) 21.1 MiB/s in 3s ETA: 0s
info: installing component 'rustfmt'
info: default toolchain set to 'stable-x86_64-pc-windows-msvc'
stable-x86_64-pc-windows-msvc installed - rustc 1.84.0 (9fc6b4312 2025-01-07)
Rust is installed now. Great!
To get started you may need to restart your current shell.
This would reload its PATH environment variable to include
Cargo's bin directory (%USERPROFILE%\.cargo\bin).
Press the Enter key to continue.
(mlcllm) C:\Users\Administrator\Desktop\mlc-llm-main\mlc-llm>
如果安装后在终端尝试执行 rustc --version
失败,需要设置环境变量
查看ls -l ~/.cargo/bin 目录
ls -l ~/.cargo/bin
(mlcllm) C:\Users\Administrator\Desktop\mlc-llm-main\mlc-llm>ls -l ~/.cargo/bin
total 178808
-rwxr-xr-x 14 Administrator 197108 13077698 Jan 27 21:04 cargo-clippy.exe
-rwxr-xr-x 14 Administrator 197108 13077698 Jan 27 21:04 cargo-fmt.exe
-rwxr-xr-x 14 Administrator 197108 13077698 Jan 27 21:04 cargo-miri.exe
-rwxr-xr-x 14 Administrator 197108 13077698 Jan 27 21:04 cargo.exe
-rwxr-xr-x 14 Administrator 197108 13077698 Jan 27 21:04 clippy-driver.exe
-rwxr-xr-x 14 Administrator 197108 13077698 Jan 27 21:04 rls.exe
-rwxr-xr-x 14 Administrator 197108 13077698 Jan 27 21:04 rust-analyzer.exe
-rwxr-xr-x 14 Administrator 197108 13077698 Jan 27 21:04 rust-gdb.exe
-rwxr-xr-x 14 Administrator 197108 13077698 Jan 27 21:04 rust-gdbgui.exe
-rwxr-xr-x 14 Administrator 197108 13077698 Jan 27 21:04 rust-lldb.exe
-rwxr-xr-x 14 Administrator 197108 13077698 Jan 27 21:04 rustc.exe
-rwxr-xr-x 14 Administrator 197108 13077698 Jan 27 21:04 rustdoc.exe
-rwxr-xr-x 14 Administrator 197108 13077698 Jan 27 21:04 rustfmt.exe
-rwxr-xr-x 14 Administrator 197108 13077698 Jan 27 21:04 rustup.exe
(mlcllm) C:\Users\Administrator\Desktop\mlc-llm-main\mlc-llm>
安装完成后,打开一个新的命令提示符或PowerShell窗口,并输入以下命令
验证rustc Cargo是否正确安装
cargo --version
rustc --version