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
- Change to the correct project root that contains
pyproject.tomlorsetup.py, then rerunpython -m pip install .. - If this is your project, add a valid
pyproject.toml(recommended) orsetup.pyand 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
- 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
- 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:
pwd(orcdpath). - List packaging files:
ls -la pyproject.toml setup.py. - 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
- For a local project directory install (
pip install .), pip expects modern packaging metadata inpyproject.tomlor legacy metadata insetup.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.
Prevention Tips
- Prefer wheels for installs, especially in CI (they avoid many build-time issues).
- When publishing, validate that sdists include
pyproject.toml/setup.pyand 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."
)