All guidesMore providers: databases, auth, hosting, email and payments
On this page

Vercel Python error

ModuleNotFoundError: No module named "supabase" on a Vercel FastAPI app

By Ohad Krispin, founder of VibeRaven · LinkedIn

Short answer

"ModuleNotFoundError: No module named 'supabase'" is Python saying your FastAPI function started and tried to import a package that is not in the deployed bundle. Vercel installs packages from one dependency file. Its builder starts in the folder of your entrypoint and walks up toward the repo root, uses the nearest pyproject.toml, Pipfile.lock, Pipfile or requirements.txt, and a pyproject.toml wins over a requirements.txt in the same folder. A requirements.txt in a sibling folder such as backend/ is never read, and the build log then says "No Python manifest found". Put the file where the builder looks, list the package, redeploy. Reproduced with @vercel/python 30.0.1 on 2026-10-31.

Before you launch: run

npx -y viberaven@1.8.0 check
.

It lists launch gaps in a Vercel + Supabase repo, such as tables without row level security in the migrations and a service role key in client code. It runs locally with no account and reads the repo, not your live database: advice, not a gate.

Or ask your coding agent to "run npx -y viberaven@1.8.0 check and fix what it reports".

Which dependency file does Vercel read, and where does it look?

The Vercel Python runtime docs say dependencies go in pyproject.toml (with or without uv.lock), requirements.txt, or a Pipfile with its Pipfile.lock. They do not say where the file must sit. The builder source (discoverPythonPackage in @vercel/python-analysis) does: it starts in the entrypoint's folder and moves up one folder at a time, and the first manifest it finds is the one used. In a run of @vercel/python-analysis 0.15.2 on 2026-10-31 these layouts gave these results.

Output
api/index.py + requirements.txt at the root   -> requirements.txt (fastapi)
api/index.py + backend/requirements.txt       -> NO MANIFEST
app/main.py + app/requirements.txt            -> app/requirements.txt (fastapi, supabase)
main.py + requirements.txt + pyproject.toml   -> pyproject.toml (dependencies = [])

The package is in requirements.txt and the import still fails

Three causes fit that. A pyproject.toml in the same folder wins, and if its dependencies list is empty nothing from requirements.txt is installed: the last layout above shows it. The requirements.txt may sit in a folder the lookup never visits, as in the second layout. Or the name in the error is the import name, which can differ from the name you list: in a test on 2026-10-31, python-dotenv 1.2.4 installed a module named dotenv, so the error says No module named 'dotenv' while requirements.txt needs python-dotenv.

What does the build log say when no file is found?

In packages/python/src/install.ts the builder prints "No Python manifest found; creating an empty pyproject.toml and uv.lock..." and installs nothing. The build goes on with an empty dependency list instead of failing, so the problem only appears at runtime, as a traceback in the Runtime Logs. If the browser shows a CORS error instead, the crashed function sent no CORS header; see the CORS error from a Vite app to FastAPI.

How to fix it, then check the fix

  1. 1
    Open the deployment's build log and look for the line "No Python manifest found". If it is there, the builder found no dependency file next to the entrypoint or above it.
  2. 2
    Find the entrypoint folder and every dependency file in the repo:
    Output
    find . \( -name requirements.txt -o -name pyproject.toml -o -name Pipfile \) -not -path "./node_modules/*" -not -path "./.venv/*"
  3. 3
    Move or copy the file to the entrypoint folder or to the repo root. If a pyproject.toml is in the same folder, list the packages in its dependencies, or delete it; it wins over requirements.txt.
  4. 4
    List the missing package under its install name, then check the file has it:
    Output
    python -m pip install supabase
    python -m pip freeze | grep -i supabase
    # add the printed line to requirements.txt
  5. 5
    Redeploy and open a route that imports the package. The Runtime Logs should show no ModuleNotFoundError. The docs ask you to list only packages needed at runtime, to keep the bundle small.

Official docs behind this checklist

FAQ for builders before launch

Can requirements.txt live in a backend/ folder?

Yes, when the entrypoint is in backend/ or below it. The lookup starts at the entrypoint folder, so backend/main.py finds backend/requirements.txt. An entrypoint in api/ does not.

Which Python version does Vercel use?

The Python runtime docs list 3.12 (the default), 3.13 and 3.14. Set it with pyproject.toml, .python-version or Pipfile.lock; if it is missing or not supported, Vercel uses the default.

Is ModuleNotFoundError different from ImportError?

It is a subclass. The Python docs say ModuleNotFoundError is raised by import when a module could not be located, and ImportError covers other trouble loading one, such as a name that is not in the module.