{
  "id": "pip/requirements-file-encoding-issue",
  "signature": "ERROR: Could not open requirements file: [Errno 2] No such file or directory: 'requirements\\.txt'",
  "signature_zh": "错误：无法打开需求文件：[Errno 2] 没有那个文件或目录：'requirements\\.txt'",
  "regex": "ERROR: Could not open requirements file: \\[Errno 2\\] No such file or directory: '.+'",
  "domain": "pip",
  "category": "config_error",
  "subcategory": null,
  "root_cause": "The requirements file path contains a Unicode character that is misinterpreted due to shell escaping or file system encoding mismatch (e.g., a non-breaking space or right-to-left mark in the filename), causing the actual file path to differ from the specified one.",
  "root_cause_type": "generic",
  "root_cause_zh": "需求文件路径包含由于 shell 转义或文件系统编码不匹配而被误解的 Unicode 字符（例如文件名中的不间断空格或从右到左标记），导致实际文件路径与指定路径不同。",
  "versions": [
    {
      "version": "pip 23.3",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "pip 24.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "pip 24.2",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "Use a different shell (e.g., bash instead of zsh) to run the pip command",
      "why_fails": "The issue is not shell-specific; the filename on disk contains an invisible Unicode character that persists across shells.",
      "fail_rate": 0.95,
      "condition": "",
      "sources": []
    },
    {
      "action": "Rename the file using mv requirements.txt requirements_fixed.txt",
      "why_fails": "If the filename contains invisible characters, typing 'requirements.txt' in the mv command may also include those characters, resulting in the same filename or a different one.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Use tab completion to select the exact filename from the filesystem: pip install -r ./req<tab>",
      "success_rate": 0.9,
      "how": "Use tab completion to select the exact filename from the filesystem: pip install -r ./req<tab>",
      "condition": "",
      "sources": []
    },
    {
      "action": "List the directory with ls -b to see escaped characters and recreate the file with a clean name: ls -b | grep requirements && cp \"$(ls | grep requirements)\" requirements_clean.txt",
      "success_rate": 0.85,
      "how": "List the directory with ls -b to see escaped characters and recreate the file with a clean name: ls -b | grep requirements && cp \"$(ls | grep requirements)\" requirements_clean.txt",
      "condition": "",
      "sources": []
    },
    {
      "action": "Recreate the requirements file from scratch using a text editor that shows invisible characters (e.g., vim with :set list).",
      "success_rate": 0.95,
      "how": "Recreate the requirements file from scratch using a text editor that shows invisible characters (e.g., vim with :set list).",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "使用 Tab 补全从文件系统中选择精确的文件名：pip install -r ./req<tab>",
    "使用 ls -b 列出目录以查看转义字符，并用干净名称重新创建文件：ls -b | grep requirements && cp \"$(ls | grep requirements)\" requirements_clean.txt",
    "使用能显示不可见字符的文本编辑器（例如带 :set list 的 vim）从头重新创建需求文件。"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://pip.pypa.io/en/stable/user_guide/#requirements-files",
  "official_doc_section": null,
  "error_code": "ERROR",
  "verification_tier": "ai_generated",
  "confidence": 0.8,
  "fix_success_rate": 0.9,
  "resolvable": "true",
  "first_seen": "2024-02-10",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}