Django deploy on Vercel fails because Cargo (Rust) is not installed
Cargo, 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.
Fix it fast
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.txt2Match what you see, then jump to its fix
- 1
The 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
The 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
- 1
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 --version2Fix
Raise the pin to a release that has wheels for your Python version, or loosen it so pip can pick one.
# requirements.txt
cryptography>=423Verify
Re-run the binary-only install.
pip install --only-binary :all: -r requirements.txtConfirmed by cryptography.io
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.toml2Fix
Pin a supported Python version that your packages publish wheels for.
# .python-version
3.133Verify
Commit and redeploy, then confirm the build log shows the version you set.
git add .python-version && git commit -m "pin python" && npx vercel --prodConfirmed by vercel.com
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:
- stegnor.comMy company site: 804 pages from a Python and Jinja generator, with 15 free browser tools.
- MenuloA restaurant discovery platform in Germany, kept current by a Python ingestion pipeline.
- ShopGoAn e-commerce aggregator with a Python scraping engine behind its catalog, past 10K Google Play downloads.
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 fixWeb 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 fixWeb apps
django-tailwind cannot find the npm executable (cPanel, Windows, Linux)
CommandError raised by the tailwind management command about npm
django-tailwind runs npm as a subprocess, and Python sometimes cannot find it.
3 causes, each with a fixWeb apps
Flask-WTF raises KeyError: A secret key is required to use CSRF
KeyError: 'A secret key is required to use CSRF.'
Flask-WTF signs its CSRF token with the app's SECRET_KEY, or with WTF_CSRF_SECRET_KEY if you set that.
4 causes, each with a fixWeb 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 fixWeb apps
AuthUserPoolException: Auth UserPool not configured in a Next.js app
Auth UserPool not configured
The error means an Amplify Auth call ran before Amplify.configure did.
3 causes, each with a fix