Skip to content
Latchkey

pip "neither setup.py nor pyproject.toml found" in CI

pip was told to install a local directory or VCS checkout as a project, but that path has no setup.py or pyproject.toml, so pip cannot build it. The path is wrong, or the project metadata lives in a subdirectory.

What this error means

A pip install . / pip install -e . / VCS install fails with "neither 'setup.py' nor 'pyproject.toml' found" or "directory ... is not installable." pip never builds anything because there is no project to build at that path.

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

Pointing pip at the wrong directory

CI runs pip install . from a directory that is not the package root, or the build metadata sits in a subfolder.

Project genuinely lacks packaging metadata

The repo has no pyproject.toml/setup.py, so it is a collection of scripts, not an installable distribution.

VCS install missing subdirectory

A pip install "git+https://...#subdirectory=pkg" install needs the subdirectory= fragment when the package is not at the repo root.

How to fix it

Install from the correct path

  1. Run pip from the directory that contains pyproject.toml/setup.py.
  2. If metadata is in a subfolder, target it: pip install ./packages/mypkg.
  3. For VCS installs, add #subdirectory=<path> to the URL.

Add minimal packaging metadata

If the project should be installable, add a pyproject.toml.

pyproject.toml
[build-system]
requires = ["setuptools>=64", "wheel"]
build-backend = "setuptools.build_meta"

[project]
name = "mypkg"
version = "0.1.0"

How to prevent it

  • Install from the package root, or pass the subdirectory explicitly.
  • Keep a valid pyproject.toml for any installable project.
  • For monorepos, target each package path precisely in CI.

Related guides

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