docker-library / docker-library/python

Package name uppercase problem with windows image

Đang mở
#1,049 3 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Ngôn ngữ chính
Dockerfile
Star
2.8k
Fork
1.1k
Merge trung bình
3 ngày 1 giờ
Pull request đã merge (30 ngày)
1

Mô tả

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

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Hướng nghiên cứu

Bắt đầu bằng cách tái hiện chuỗi thao tác đã báo cáo trong image python:3.13.3-windowsservercore-ltsc2022: cài đặt PyPDF2, gỡ cài đặt nó, cài đặt lại và so sánh các đường dẫn import. Kiểm tra hành vi của Windows image liên quan đến pip uninstall và site-packages; được xem là hoàn tất khi một package có các chữ cái viết hoa có thể được gỡ cài đặt và cài đặt lại mà vẫn import được bằng tên dự kiến.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
docker, python
Lĩnh vực
infrastructure
Loại issue
Lỗi
Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức độ hoạt động
Sôi nổi
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
48/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.