Error Knowledge Base PIP DIRECTORY_NOT_INSTALLABLE

ERROR: Directory '.' is not installable. Neither 'setup.py' nor 'pyproject.toml' found.

You asked pip to install from a local directory or sdist, but it doesn't contain standard Python packaging metadata (`pyproject.toml` or `setup.py`).

Affected versions: All pip versions.

What This Error Means

You asked pip to install from a local directory or sdist, but it doesn't contain standard Python packaging metadata (pyproject.toml or setup.py).

How to Fix It

  1. Change to the correct project root that contains pyproject.toml or setup.py, then rerun python -m pip install ..
  2. If this is your project, add a valid pyproject.toml (recommended) or setup.py and rebuild distributions.
  3. If you're consuming someone else's sdist and it's missing files, use a wheel if available, or report/fix the packaging so the sdist includes required metadata.

Why It Happens

  • You ran pip install . from the wrong directory (not the project root).
  • The project isn't a Python package (missing packaging configuration).
  • The sdist was built incorrectly and omitted packaging files.

How to Verify

  1. Re-run python -m pip install . and confirm pip starts building/installing instead of failing immediately.
  2. If installing an sdist, confirm pip can build a wheel successfully.

Manual project layout checks

  1. Confirm you're in the directory you expect: pwd (or cd path).
  2. List packaging files: ls -la pyproject.toml setup.py.
  3. If installing an sdist file, inspect its contents: tar -tf package.tar.gz | head.

Common CLI Output

ERROR: Directory '.' is not installable. Neither 'setup.py' nor 'pyproject.toml' found.
ERROR: file:///path/to/dist/test-project-0.0.1.tar.gz does not appear to be a Python project: neither 'setup.py' nor 'pyproject.toml' found.

What pip expects in a local project

  1. For a local project directory install (pip install .), pip expects modern packaging metadata in pyproject.toml or legacy metadata in setup.py.
  2. For sdists (.tar.gz), pip expects the archive to contain those files at the project root inside the archive.
  3. If those files are missing, pip cannot build a wheel or install the project.

Prevention Tips

  • Prefer wheels for installs, especially in CI (they avoid many build-time issues).
  • When publishing, validate that sdists include pyproject.toml/setup.py and required sources.
  • Document the correct project root and packaging layout for contributors.

Where This Can Be Triggered

github.com/pypa/pip/blob/25.3/src/pip/_internal/req/constructors.py

pip raises an InstallationError when you ask it to install a local directory that isn't a Python project (missing pyproject.toml and setup.py). - GitHub

if _looks_like_path(name) and os.path.isdir(path):
    if is_installable_dir(path):
        return path_to_url(path)
    # TODO: The is_installable_dir test here might not be necessary
    #       now that it is done in load_pyproject_toml too.
    raise InstallationError(
        f"Directory {name!r} is not installable. Neither 'setup.py' "
        "nor 'pyproject.toml' found."
    )

Need help or found a mistake? Contact RepoFlow support for questions.

Join our mailing list