Installing Rust & Cargo on a Windows 10 PC
The Rust website offers easy ways to install Rust and its build tool and package manager, Cargo, for several different operating systems.
However, if you use a Windows 10 PC, the simplest path is to just click on the Rust site's "Install" link and choose rustup as recommended. Depending on whether you are using a 32-bit or 64-bit Windows PC, click on the appropriate link to download the rustup-init.exe file. (Note: There is also a Rust download link for those who use a Windows subsystem for Linux.)
Pay close attention to the "Notes about Rust installation" section of the "Install Rust" page. Rust will try to configure the PATH environment variable during installation. But you may need to reboot your computer, or edit the PATH, or even reinstall Rust if there is a problem.
Once installation is complete, go to a command prompt and enter the following commands in any order:
rustc --version
rustdoc --version
cargo --version
You should get responses similar to these:
c:\>rustc --version
rustc 1.66.1 (90743e729 2023-01-10)
c:\>rustdoc --version
rustdoc 1.66.1 (90743e729 2023-01-10)
c:\>cargo --version
cargo 1.66.1 (ad779e08b 2023-01-10)
Rust is working, so now take some time to look at The Cargo Book. According to that publication:
"Cargo is the Rust package manager. Cargo downloads your Rust package's dependencies, compiles your packages, makes distributable packages, and uploads them to crates.io, the Rust community’s package registry. You can contribute to this book on GitHub."
If you happen to have an older version of Rust already installed on your Windows PC, just run the command rustup update to get the most-recent release. After Rust is updated, test the installation using the --version
commands listed above.
Thanks for reading. Feedback welcome. (And yes, this is my first big try at writing something with Markdown, so I do have more to learn).
Top comments (0)