Rust errors / Build and Cargo
Rust build error · checked with Rust 1.99.0
error: failed to select a version for the requirement
error: failed to select a version for the requirement
What it meansCargo cannot find a version of a crate that satisfies every requirement in your dependency tree at once (or the version you asked for does not exist, or needs a newer Rust).
Why it happens
- Two dependencies need incompatible versions of a crate that only allows one copy (links = "..." crates like openssl-sys or libsqlite3-sys).
- A typo or a version that was never published (or was yanked).
- Your rust-version (MSRV) excludes every matching version with the MSRV-aware resolver.
- An old Cargo.lock with an offline or outdated index.
How to fix it
1. Read which crates pull it in
cargo tree -i <crate> --target all2. Update the index and lock file
cargo update3. Align the conflicting dependencies
Upgrade the dependency that needs the older version, or pin a compatible one.
cargo update -p <crate> --precise <version>Other wordings of this error
failed to select a version for the requirement, failed to select a version for, candidate versions found which didn't match, versions that meet the requirements are
Other build errors
- error: linker `link.exe` not found
- error: linker `cc` not found
- error: failed to run custom build command for `openssl-sys`
- error: failed to select a version for `libsqlite3-sys`... the package `libsqlite3-sys` lin
- error: could not compile `my-crate` (bin "my-crate") due to 1 previous error
- error: package `foo v1.2.3` cannot be built because it requires rustc 1.80 or newer, while
- feature `edition2024` is required
- Blocking waiting for file lock on package cache
Up next
Find the right pagePaste any Rust errorCompiler codes and build errors in one finder.Read it next →Also worth your time
Did this answer your question?