{"record":{"id":"6c6461d44a8ad040","repo":"pypa/pip","slug":"req-name-does-not-appear-to-be-a-python-project","errorCode":null,"errorMessage":"{req_name} does not appear to be a Python project: neither 'setup.py' nor 'pyproject.toml' found.","messagePattern":"(.+?) does not appear to be a Python project: neither 'setup\\.py' nor 'pyproject\\.toml' found\\.","errorType":"validation","errorClass":"InstallationError","httpStatus":null,"severity":"error","filePath":"src/pip/_internal/pyproject.py","lineNumber":57,"sourceCode":"        req_name - The name of the requirement we're processing (for\n                   error reporting)\n\n    Returns:\n        None if we should use the legacy code path, otherwise a tuple\n        (\n            requirements from pyproject.toml,\n            name of PEP 517 backend,\n            requirements we should check are installed after setting\n                up the build environment\n            directory paths to import the backend from (backend-path),\n                relative to the project root.\n        )\n    \"\"\"\n    has_pyproject = os.path.isfile(pyproject_toml)\n    has_setup = os.path.isfile(setup_py)\n\n    if not has_pyproject and not has_setup:\n        raise InstallationError(\n            f\"{req_name} does not appear to be a Python project: \"\n            f\"neither 'setup.py' nor 'pyproject.toml' found.\"\n        )\n\n    if has_pyproject:\n        with open(pyproject_toml, encoding=\"utf-8\") as f:\n            pp_toml = tomllib.loads(f.read())\n        build_system = pp_toml.get(\"build-system\")\n    else:\n        build_system = None\n\n    if build_system is None:\n        # In the absence of any explicit backend specification, we\n        # assume the setuptools backend that most closely emulates the\n        # traditional direct setup.py execution, and require wheel and\n        # a version of setuptools that supports that backend.\n\n        build_system = {","sourceCodeStart":39,"sourceCodeEnd":75,"githubUrl":"https://github.com/pypa/pip/blob/f399c3718970b1b0e2478dac5296eb62679a9b86/src/pip/_internal/pyproject.py#L39-L75","documentation":"Raised by load_pyproject_toml (pyproject.py:56) as InstallationError when neither a pyproject.toml nor a setup.py exists in the project directory pip was asked to build/install from. pip needs at least one of these to know how to build the project, so their absence means the target is not recognizable as a Python project.","triggerScenarios":"Installing/building from a path (local dir, sdist, or VCS checkout) that contains no pyproject.toml and no setup.py — e.g. pointing pip at a docs folder, an empty checkout, or the wrong subdirectory of a monorepo.","commonSituations":"Wrong path given to pip install; a Git submodule that wasn't initialized; a monorepo where the package lives in a subdirectory; a tarball missing its build files; a directory that is just data/notebooks.","solutions":["Verify the directory actually contains the project's setup.py or pyproject.toml (ls the path).","Point pip at the correct subdirectory: 'pip install ./path/to/real/package'.","For monorepos use the subdirectory feature of your VCS URL or path.","If the project legitimately lacks build config, add a minimal pyproject.toml with a build-backend."],"exampleFix":"# before\npip install ./   # cwd has no setup.py/pyproject.toml\n# after: point at the real package dir\npip install ./src/myproject\n# or add minimal build config\n# pyproject.toml:\n# [build-system]\n# requires = [\"setuptools>=61\"]\n# build-backend = \"setuptools.build_meta\"","handlingStrategy":"validation","validationCode":"import os, sys\n\ndef is_python_project_dir(path: str) -> bool:\n    return os.path.isfile(os.path.join(path, 'setup.py')) or os.path.isfile(os.path.join(path, 'pyproject.toml'))\n\nif __name__ == '__main__':\n    target = sys.argv[1]\n    if not is_python_project_dir(target):\n        print(f'{target} has neither setup.py nor pyproject.toml'); sys.exit(1)","typeGuard":"import os\n\ndef is_python_project(path: str) -> bool:\n    return (os.path.isdir(path)\n            and (os.path.isfile(os.path.join(path, 'setup.py'))\n                 or os.path.isfile(os.path.join(path, 'pyproject.toml'))))","tryCatchPattern":"from subprocess import run, CalledProcessError\ntry:\n    run([\"pip\", \"install\", target], check=True)\nexcept CalledProcessError:\n    # Point at the correct subdirectory containing the build files.\n    run([\"pip\", \"install\", correct_subdir], check=True)","preventionTips":["Verify the directory contains setup.py or pyproject.toml before pip install.","For monorepos, pass the package subdirectory explicitly.","Ensure git submodules are initialized before installing from a checkout."],"tags":["pyproject","setup-py","build","pep518","pip"],"backgroundTag":null,"analyzedSha":"f399c3718970b1b0e2478dac5296eb62679a9b86","analyzedAt":"2026-08-08T23:01:42.227Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}