python system_error ai_generated true

错误:由于 OSError 无法安装包:[Errno 28] 设备上没有剩余空间

ERROR: Could not install packages due to an OSError: [Errno 28] No space left on device

ID: python/pip-no-space-left-on-device-cache

其他格式: JSON · Markdown 中文 · English
80%修复率
88%置信度
0证据数
2024-04-19首次发现

版本兼容性

版本状态引入弃用备注
3.8 active — — —
3.9 active — — —
3.10 active — — —
3.11 active — — —
3.12 active — — —

根因分析

pip 的 HTTP 缓存或临时构建目录填满了磁盘。常见于 overlay 文件系统较小的 CI 容器,或者 pip 缓存在多次构建中无界增长时。

English

pip's HTTP cache or tmp build directory filled the disk. Common in CI containers with small overlay filesystems, or when the pip cache grows unbounded across many builds.

generic

解决方案

  1. 95% 成功率
    pip cache purge && pip cache dir
  2. 90% 成功率
    export TMPDIR=/mnt/bigdisk/tmp && mkdir -p $TMPDIR && pip install package
  3. 85% 成功率
    pip config set global.cache-dir /tmp/pipcache && pip install --no-cache-dir package

无效尝试

常见但无效的做法:

  1. 60% 失败

    Disables caching but the build still needs temp space; if /tmp is full it still fails.

  2. 90% 失败

    Changes install location but not disk usage; root filesystem is still full.