{"id":"60603da3aa5a02d8","repo":"python-poetry/poetry","slug":"cannot-install-non-directory-dependencies-in-edita","errorCode":null,"errorMessage":"Cannot install non directory dependencies in editable mode","messagePattern":"Cannot install non directory dependencies in editable mode","errorType":"exception","errorClass":"PoetryError","httpStatus":null,"severity":"error","filePath":"src/poetry/utils/pip.py","lineNumber":48,"sourceCode":"        \"--disable-pip-version-check\",\n        \"--isolated\",\n        \"--no-input\",\n        \"--prefix\",\n        str(environment.path),\n    ]\n\n    if not is_wheel and not editable:\n        args.insert(1, \"--use-pep517\")\n\n    if upgrade:\n        args.append(\"--upgrade\")\n\n    if not deps:\n        args.append(\"--no-deps\")\n\n    if editable:\n        if not path.is_dir():\n            raise PoetryError(\n                \"Cannot install non directory dependencies in editable mode\"\n            )\n        args.append(\"-e\")\n\n    args.append(str(path))\n\n    try:\n        return environment.run_pip(*args)\n    except EnvCommandError as e:\n        raise PoetryError(f\"Failed to install {path}\") from e\n","sourceCodeStart":30,"sourceCodeEnd":59,"githubUrl":"https://github.com/python-poetry/poetry/blob/92b74dcfe348d0e01e14d40d6c1fa47a4ee04a54/src/poetry/utils/pip.py#L30-L59","documentation":"poetry.utils.pip.pip_install with editable=True checks path.is_dir() and raises PoetryError if false. Editable (`pip install -e`) installs require a project source directory; wheels, sdists, or non-existent paths are not valid.","triggerScenarios":"Calling pip_install(path, env, editable=True) where path is a .whl file, a .tar.gz sdist, or a path that does not exist.","commonSituations":"Misconfigured dependency declaration asking for an editable install of a wheel/sdist; passing a file path where a directory is expected; a directory path that has a trailing typo so is_dir() is false.","solutions":["Pass a project directory path (containing pyproject.toml/setup.py) when editable=True.","If the target is a wheel, call pip_install with editable=False.","Verify the path exists and is a directory before requesting editable mode."],"exampleFix":"# before\npip_install(Path('pkg-1.0-py3-none-any.whl'), env, editable=True)\n# after\npip_install(Path('./pkg-1.0-py3-none-any.whl'), env, editable=False)\n# or, for a local project checkout:\npip_install(Path('./myproject'), env, editable=True)","handlingStrategy":"validation","validationCode":"from pathlib import Path\n\ndef can_editable_install(path: Path) -> bool:\n    return path.is_dir()","typeGuard":null,"tryCatchPattern":"from poetry.exceptions import PoetryError\ntry:\n    pip_install(path, env, editable=True)\nexcept PoetryError as e:\n    if 'editable' in str(e):\n        # fall back to a non-editable install\n        pip_install(path, env, editable=False)\n    raise","preventionTips":["Only request editable mode for project directories.","For wheels, always pass editable=False.","Validate path.is_dir() before building the call."],"tags":["pip","install","editable","packaging"],"analyzedSha":"92b74dcfe348d0e01e14d40d6c1fa47a4ee04a54","analyzedAt":"2026-08-04T20:33:34.072Z","schemaVersion":2}