reflex-dev/reflex · error · SystemExit
No requirements.txt found.
Error message
No requirements.txt found.
What it means
SystemExit raised by check_requirements when a requirements diff was detected but the project has no requirements.txt. The CLI compares installed packages against requirements.txt before deploying; if the environment differs and there's no requirements file to reconcile against, it aborts instead of deploying an unreproducible environment.
Source
Thrown at packages/reflex-hosting-cli/src/reflex_cli/utils/dependency.py:128
for line in lines:
if re.match(r"^\w+", line):
new_requirements_lines.add(f"{line}\n")
current_requirements_lines: set[str] = set()
if Path(constants.RequirementsTxt.FILE).exists():
with Path(constants.RequirementsTxt.FILE).open(encoding=encoding) as f:
current_requirements_lines = set(f)
logger.debug("Current requirements.txt:")
logger.debug("".join(current_requirements_lines))
diff = list(new_requirements_lines - current_requirements_lines)
if not diff:
return
if not current_requirements_lines:
logger.warning("It seems like there's no requirements.txt in your project.")
raise SystemExit("No requirements.txt found.")
logger.warning("Detected difference in requirements.txt and python env.")
logger.warning("The requirements.txt may need to be updated.")
console.ask("Do you wish to proceed? (ctl+c to cancel)")
return
def get_reflex_version() -> str:
"""Get the version of the reflex package.
Returns:
The version of the reflex package.
"""
return importlib.metadata.version(constants.Reflex.MODULE_NAME)
def is_valid_url(url: str) -> bool:
"""Check if the given URL is valid.View on GitHub (pinned to 45b8ed5ab7)
Solutions
- Generate requirements.txt for your project (e.g. `uv pip freeze > requirements.txt` or Reflex's export command) and re-run deploy
- If deps genuinely differ, align your environment with the intended dependency set before deploying
- As a workaround you can bypass the dependency check only if the CLI offers a flag to skip it (check `reflex deploy --help`)
Example fix
# before: deploy fails with SystemExit: No requirements.txt found. # after uv pip freeze > requirements.txt reflex deploy
Defensive patterns
Strategy: validation
Validate before calling
from pathlib import Path
req = Path("requirements.txt")
if not req.exists():
import subprocess
subprocess.run(["uv", "pip", "freeze"], stdout=req.open("wb"), check=True)
# safe to deploy Try / catch
import sys
try:
deploy()
except SystemExit as e:
if "No requirements.txt" in str(e):
generate_requirements()
deploy() # retry once
else:
raise Prevention
- Always keep an up-to-date requirements.txt in projects you deploy
- Regenerate requirements.txt whenever dependencies change
- Run `reflex deploy` from the project root
When it happens
Trigger: Running `reflex deploy` (which calls check_requirements) in a project without requirements.txt, while the installed environment differs from the expected dependency set (diff is non-empty and current_requirements_lines is empty).
Common situations: Deploying a new project where dependencies were installed via pyproject/uv only and requirements.txt was never exported; the file was deleted or renamed.
Related errors
- YAML support is not available. Please install PyYAML to use
- ComputedVar dependencies must be Var instances or var names
- ComputedVar dependencies must be Var instances with a state
- Cannot track dependencies without caching.
- f"Invalid {self._cloud_config_path.name}. " + str(e)
AI-assisted analysis of reflex-dev/reflex@45b8ed5ab7 (2026-08-28).
Data as JSON: /api/errors/e67429e6c9b2ef67.
Report an issue: GitHub.