{"id":"a5da19538ebf4e4b","repo":"python-poetry/poetry","slug":"failed-to-install-path","errorCode":null,"errorMessage":"Failed to install {path}","messagePattern":"Failed to install (.+?)","errorType":"exception","errorClass":"PoetryError","httpStatus":null,"severity":"error","filePath":"src/poetry/utils/pip.py","lineNumber":58,"sourceCode":"    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":40,"sourceCodeEnd":59,"githubUrl":"https://github.com/python-poetry/poetry/blob/92b74dcfe348d0e01e14d40d6c1fa47a4ee04a54/src/poetry/utils/pip.py#L40-L59","documentation":"pip_install wraps environment.run_pip(*args) in try/except EnvCommandError and re-raises as PoetryError('Failed to install {path}') chaining the original EnvCommandError as __cause__. It means the underlying `pip install` invocation exited non-zero for the given path.","triggerScenarios":"Any pip_install where pip fails: dependency conflict, incompatible/unsupported wheel for the interpreter, permission denied on the env prefix, network failure fetching deps (when deps=True), or a corrupt package.","commonSituations":"Installing a wheel built for a different Python/ABI/platform; permission errors writing into the environment prefix; pip resolver conflict when deps are not suppressed; transient network errors.","solutions":["Inspect the chained EnvCommandError (the __cause__) for pip's actual stderr/stdout to find the real reason.","Confirm the path exists and is a valid package/wheel for the target interpreter.","Check write permissions on environment.path and available disk.","If deps=True, resolve the underlying dependency conflicts or install with --no-deps where appropriate."],"exampleFix":"# before\ntry:\n    pip_install(path, env)\nexcept PoetryError:\n    pass   # original pip stderr is lost\n# after - surface the real cause\ntry:\n    pip_install(path, env)\nexcept PoetryError as e:\n    raise RuntimeError(f'pip failed: {e.__cause__}') from e","handlingStrategy":"try-catch","validationCode":"from pathlib import Path\n\ndef installable(path: Path, env) -> bool:\n    return path.exists() and env.path.exists() and os.access(env.path, os.W_OK)","typeGuard":null,"tryCatchPattern":"from poetry.exceptions import PoetryError\ntry:\n    pip_install(path, environment)\nexcept PoetryError as e:\n    cause = e.__cause__   # the underlying EnvCommandError with pip's stderr\n    print('pip stderr:', getattr(cause, 'output', cause))\n    raise","preventionTips":["Read the chained EnvCommandError to see pip's real error.","Confirm the path is a valid package for the target interpreter.","Verify write permissions and disk space on the env prefix."],"tags":["pip","install","packaging","dependencies"],"analyzedSha":"92b74dcfe348d0e01e14d40d6c1fa47a4ee04a54","analyzedAt":"2026-08-04T20:33:34.072Z","schemaVersion":2}