python install_error ai_generated true

ERROR: Invalid requirement: 'foo==1.0.0' Hint: It looks like a path. File 'foo==1.0.0' does not exist.

ID: python/pip-invalid-requirement-no-matching-distribution

Also available as: JSON · Markdown · 中文
80%Fix Rate
85%Confidence
0Evidence
2024-05-20First Seen

Version Compatibility

VersionStatusIntroducedDeprecatedNotes
3.9 active — — —
3.10 active — — —
3.11 active — — —
3.12 active — — —

Root Cause

pip parsed the argument as a local path because of quoting or shell expansion issues, or the requirement string contains invalid characters.

generic

中文

由于引号或 shell 展开问题,pip 将参数解析为本地路径,或者要求字符串包含无效字符。

Workarounds

  1. 92% success
    Quote the requirement: `pip install 'foo==1.0.0'` (single quotes on Unix).
  2. 80% success
    Check for stray spaces or shell globbing; use `--` separator: `pip install -- foo==1.0.0`.

Dead Ends

Common approaches that don't work:

  1. 90% fail

    The user intended to install a package, not reference a file.

  2. 80% fail

    Does not fix parsing of the requirement.