python
config_error
ai_generated
true
ERROR: Could not open requirements file: [Errno 2] No such file or directory: 'requirements/base.txt'
ID: python/pip-req-file-not-found-relative
80%Fix Rate
87%Confidence
0Evidence
2024-11-19First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| 3.x | active | — | — | — |
Root Cause
The -r path is resolved relative to the current working directory, not to the file that contains the -r line.
generic中文
-r 路径相对于当前工作目录解析,而不是相对于包含 -r 行的文件。
Workarounds
-
98% success
cd /path/to/project pip install -r requirements/base.txt
-
95% success
# requirements.txt at project root -r requirements/base.txt -r requirements/dev.txt pip install -r requirements.txt
Dead Ends
Common approaches that don't work:
-
90% fail
--no-index affects package lookup, not file resolution.
-
85% fail
MANIFEST.in is for sdist contents, not for pip's requirements resolution.
-
60% fail
Changes the base for resolution but may break other relative paths in the same file.