docker-library / docker-library/python

Package name uppercase problem with windows image

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

还没有人认领这个 Issue。

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

描述

Overview

I found a strange pip problem on windows based image related to python packages that are installed with capital letters in their folder name.

The problem is happening when uninstalling a package with uppercase letters in its name, eg: PyPDF2.

I confirm Linux images don't have this problem.

How to reproduce

Here are minimal reproducible steps:

docker pull python:3.13.3-windowsservercore-ltsc2022
docker run --rm -it python:3.13.3-windowsservercore-ltsc2022 powershell

# First install
pip install PyPDF2
python -c "import PyPDF2 as p; print(p.__file__)"

# Prints:
C:\Python\Lib\site-packages\PyPDF2\__init__.py

pip uninstall -y PyPDF2

# 2nd install
pip install PyPDF2
python -c "import PyPDF2 as p; print(p.__file__)"

# Prints:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
    import PyPDF2 as p; print(p.__file__)
    ^^^^^^^^^^^^^^^^^^
ModuleNotFoundError: No module named 'PyPDF2'

# Let's try lowercase:

python -c "import pypdf2 as p; print(p.__file__)"

# Prints:

C:\Python\Lib\site-packages\pypdf2\__init__.py

# Even if:
pip freeze

# Prints:
PyPDF2==3.0.1

贡献指南

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

从这里开始

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

调研方向

首先在 python:3.13.3-windowsservercore-ltsc2022 镜像中复现报告的操作序列:安装 PyPDF2,卸载它,重新安装它,并比较导入路径。检查 Windows 镜像在 pip uninstall 和 site-packages 方面的行为;当包含大写字母的包能够被卸载并重新安装,同时仍可使用其预期名称导入时,即表示完成。

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

评估

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

把新 issue 发到你的邮箱

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