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`).

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).

Read this as a precise clue about which part of the workflow broke first. Once you know the failing layer, the fix path gets much shorter.

How to Fix It

Change to the correct project root that contains pyproject.toml or setup.py, then rerun python -m pip install ..

If this is your project, add a valid pyproject.toml (recommended) or setup.py and rebuild distributions.

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

Usually this comes down to you ran pip install . from the wrong directory (not the project root), the project isn't a Python package (missing packaging configuration), or the sdist was built incorrectly and omitted packaging files.

Verify the Fix

Re-run python -m pip install . and confirm pip starts building/installing instead of failing immediately.

If installing an sdist, confirm pip can build a wheel successfully.

Manual project layout checks

Confirm you're in the directory you expect with pwd (or cd path), list packaging files with ls -la pyproject.toml setup.py, and if installing an sdist file, inspect its contents with tar -tf package.tar.gz | head.

Examples

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

This is the part worth understanding if the quick fix did not hold. It explains what pip is trying to do at the moment the error appears.

For a local project directory install (pip install .), pip expects modern packaging metadata in pyproject.toml or legacy metadata in setup.py.

For sdists (.tar.gz), pip expects the archive to contain those files at the project root inside the archive. If those files are missing, pip cannot build a wheel or install the project.

Prevent It From Coming Back

To prevent this, 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, and document the correct project root and packaging layout for contributors.

Docs and source code

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