docker-library / docker-library/python

pip._internal.models ModuleNotFoundError in Official Python Slim Docker Images

未关闭
#1,121 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

主要语言
Dockerfile
星标
2.8k
派生
1.1k
平均合并
3 天 1 小时
30 天内合并 PR
1

描述

Official Python slim Docker images are shipping with a broken pip installation as of late May / June 2026. Any pip command fails immediately on a fresh pull with no modifications to the image.

Affected Images

  • python:3.10-slim-buster
  • python:3.11-slim

Reproduce

docker run --rm python:3.10-slim-buster pip install requests
docker run --rm python:3.11-slim pip install requests

No apt installs, no pip upgrades, no Dockerfile changes, fails on a clean pull.

Error

File "/usr/local/lib/python3.10/site-packages/pip/_internal/locations/__init__.py", line 9
    from pip._internal.models.scheme import SCHEME_KEYS, Scheme
ModuleNotFoundError: No module named 'pip._internal.models'

Impact

Silent breaking change. Builds working with zero Dockerfile modifications are
Now broken.

Environment

  • Docker: 26.x
  • Host OS: Linux
  • Date observed: June 1, 2026

贡献指南

这个仓库没有索引到贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

使用列出的 docker run 命令复现 python:3.10-slim-buster 和 python:3.11-slim 的失败,然后检查官方镜像的打包方式以及针对所报告缺失模块的 pip 安装。完成标准是:全新拉取每个受影响的镜像后,无需额外修改 Dockerfile 或 apt,即可成功运行 pip install requests。

由索引模型根据 Issue 内容生成。

评估

技术栈
docker, python
领域
devops, infrastructure
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
活跃
描述清晰度
基本清楚
新手友好度
45/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。