Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4072 pages
Next.js and React

Django deploy on Vercel fails because Cargo (Rust) is not installed

ErrorCargo, the Rust package manager, is not installed or is not on PATH.

Short answer

The message means one of your packages had no ready-made wheel for the Python version Vercel used, so pip tried to build it from source, and that needs Rust. Find the package, then pin a release that ships wheels or set a Python version it supports.

  • Applies to Python 3.12, Python 3.13, pip 24, Django 5, Vercel
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Fix it fast

  1. 1Find out which cause you have

    Ask pip to refuse source builds. The install then fails on the exact package that has no wheel for your Python version.

    python -m venv /tmp/check && . /tmp/check/bin/activate
    pip install --only-binary :all: -r requirements.txt
  2. 2Match what you see, then jump to its fix

    1. 1The first_step command names one package, often one with a Rust extension such as cryptographyA pinned old version of a package has no wheel for this PythonFix
    2. 2The build log shows a Python version you did not choose, or your package lists lower versions onlyVercel built with a Python version your packages do not support yetFix

What does the error look like?

  • Cargo, the Rust package manager, is not installed or is not on PATH.

Cause 1 of 2

A pinned old version of a package has no wheel for this Python

1Check

pip builds from source only when no matching wheel exists. Building a package like cryptography needs a working Rust toolchain, and it ships wheels for common platforms. An old pin, or an old pip, is the usual reason a wheel is not used.

pip --version

2Fix

Raise the pin to a release that has wheels for your Python version, or loosen it so pip can pick one.

# requirements.txt
cryptography>=42

3Verify

Re-run the binary-only install.

pip install --only-binary :all: -r requirements.txt

Confirmed by cryptography.io

Did this fix it?

Cause 2 of 2

Vercel built with a Python version your packages do not support yet

1Check

Vercel supports Python 3.12 (default), 3.13 and 3.14. Without a version file it uses 3.12.

cat .python-version 2>/dev/null
grep -n "requires-python" pyproject.toml

2Fix

Pin a supported Python version that your packages publish wheels for.

# .python-version
3.13

3Verify

Commit and redeploy, then confirm the build log shows the version you set.

git add .python-version && git commit -m "pin python" && npx vercel --prod

Confirmed by vercel.com

Did this fix it?

How do I stop it coming back?

  • Keep dependency pins current and re-run the binary-only check when you change Python versions.
  • Set the Python version in the repository, not by relying on a default.
  • Commit a lockfile or fully pinned requirements so builds repeat.

Sources

How was this page made?

I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.

Which stack is behind this page?

Projects of mine built on the same technologies:

Related fixes

Web apps

CORS fails when you open an HTML file straight from disk

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at file:///

A page opened from disk has an opaque origin, so browsers treat every request it makes as cross-origin, and CORS only works over http or https.

3 causes, each with a fix

Web apps

django-cors-headers settings have no effect

CORS_ALLOWED_ORIGINS not working

django-cors-headers only works when corsheaders is in INSTALLED_APPS, CorsMiddleware sits high in MIDDLEWARE (before CommonMiddleware), and at least one origin setting is defined.

4 causes, each with a fix

Web apps

tsconfig rejects allowImportingTsExtensions

An error that allowImportingTsExtensions needs noEmit or emitDeclarationOnly

allowImportingTsExtensions lets files import each other with .ts or .tsx extensions, and TypeScript only allows it together with noEmit or emitDeclarationOnly.

2 causes, each with a fix

Next step

Want this handled for good?

I look after servers, apps and releases end to end. Tell me what keeps breaking.