Skip to content
Latchkey

pip "file:// ... does not appear to be a Python project" in CI

pip was pointed at a directory to install as a project, but that directory has no pyproject.toml or setup.py. Usually the path is wrong, the checkout is shallow, or the working directory is not the project root.

What this error means

pip install . or pip install -e <path> fails immediately with "does not appear to be a Python project: neither setup.py nor pyproject.toml found". Nothing builds because pip found no project to build.

pip output
ERROR: file:///home/runner/work/repo does not appear to be a Python project:
neither 'setup.py' nor 'pyproject.toml' found.

Common causes

Wrong directory or path

The path given to pip points at the repo root when the project lives in a subdirectory (or vice versa), so no metadata file is present there.

Metadata file missing from the checkout

A sparse/partial checkout, a .dockerignore/.gitignore that excluded pyproject.toml, or a build context that did not copy it leaves the directory without project metadata.

How to fix it

Point pip at the directory that holds the metadata

Confirm where pyproject.toml/setup.py actually is and install from there.

Terminal
ls pyproject.toml setup.py 2>/dev/null
pip install -e ./packages/my-lib   # the dir that contains the metadata

Make sure the metadata is in the build context

  1. Check .dockerignore/.gitignore does not exclude pyproject.toml.
  2. Use a full (not shallow/sparse) checkout if the file is missing.
  3. In Docker, COPY pyproject.toml setup.py ./ before pip install -e ..

How to prevent it

  • Install from the directory that actually contains the project metadata.
  • Keep pyproject.toml out of ignore files used for the build context.
  • Verify the file exists in CI before the install step.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →