cargo: failed to select a version for the requirement Rust Origin: Application & API OSI layer 7 · Application Last updated 5 Nov 2026

Cargo: error: failed to select a version for the requirement `serde = "^2.0"` — candidate versions found which didn't match: 1.0.197

Cargo can't find a version of a dependency satisfying the constraints you (or other crates) set.

Exact message you may see error: failed to select a version for the requirement `serde = "^2.0"`candidate versions found which didn't match: 1.0.197error: failed to select a version for `x`failed to select a version for the requirementall possible versions conflict with previously selected packages
Seen on: Rust

Meaning

Relax or correct the version in Cargo.toml (serde = "1"), check crate name/features, and see conflicts with cargo tree -d. Yanked versions, MSRV (rust-version) limits and overly strict =x.y.z pins create this. cargo update -p crate refreshes the lockfile.

Common causes

  • Version requirement higher than published
  • Conflicting requirements between dependencies
  • Yanked version in Cargo.lock
  • Wrong crate name or feature
  • Registry index outdated/offline

⚡ Quick fix

  1. Edit Cargo.toml to an existing version (cargo search crate)
  2. cargo update -p crate
  3. Use cargo tree -i crate to see who requires what

Detailed fix by platform

Rust

  1. cargo search serde --limit 1 && cargo tree -i serde

How to diagnose

  1. Requirement — Version exists?
  2. Conflicts — cargo tree -d?
  3. Registry — Reachable?

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

Where this error sits

Origin: Application & API. Errors that are often confused with or caused by this one (click to open):

Blocking waiting for file lock on package cache / build directory — Cargo: Blocking waiting for file lock on package cache / on build directory (Rust)Blocking waiting for …Cannot start a runtime from within a runtime (Tokio) — Rust: thread 'main' panicked: Cannot start a runtime from within a runtime — a function like `block_on` tried to block a thread that drives async tasks (Rust)Cannot start a runtim…cargo: failed to get from registry (spurious network error) — Cargo: warning: spurious network error (2 tries remaining): [35] SSL connect error / error: failed to download from `https://index.crates.io/...` (Rust)cargo: failed to get …E0004: non-exhaustive patterns — Rust: error[E0004]: non-exhaustive patterns: `None` not covered (Rust)E0004: non-exhaustive…E0015: cannot call non-const function in constants — Rust: error[E0015]: cannot call non-const function `String::from` in constants (Rust)E0015: cannot call no…E0038: the trait cannot be made into an object — Rust: error[E0038]: the trait `Shape` cannot be made into an object (not dyn compatible) (Rust)E0038: the trait cann…E0061: this function takes N arguments but M were supplied — Rust: error[E0061]: this function takes 2 arguments but 1 argument was supplied (Rust)E0061: this function …E0063: missing field in initializer of struct — Rust: error[E0063]: missing field `age` in initializer of `User` (Rust)E0063: missing field …cargo: fa…

Explore the map of this error Full error map →

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.

💬 What worked for others

No tips yet — did something else fix this for you?

Share what worked for you

Tips are checked by an editor before they appear. Links are removed.