Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

ModuleNotFoundError: No module named 'wheel.cli'

Đã đóng
#3,293 3 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@C0rn3j đang làm issue này rồi.

Từ ngày 24/3/2026.

  • #3296 của @C0rn3j — đang mở
  • #3391 của @AndreMiras — đã merge

Đánh giá

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

Hướng nghiên cứu

Bắt đầu trong pythonforandroid/recipe.py tại install_wheel, nơi import từ wheel.cli.tags bị lỗi, và so sánh với cách sử dụng wheel.wheelfile được nêu trong issue. Tái hiện lỗi build Android, sau đó xác minh rằng việc cài đặt wheel và retagging nền tảng hoạt động mà không cần module không khả dụng.

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

Mô tả

easy Priority: Low

Looks like p4a is using a privated wheels.cli module which was part of https://github.com/pypa/wheel/pull/655

Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/home/user/Projects/Tauon/.buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py", line 1246, in <module>
    main()
    ~~~~^^
  File "/home/user/Projects/Tauon/.buildozer/android/platform/python-for-android/pythonforandroid/entrypoints.py", line 18, in main
    ToolchainCL()
    ~~~~~~~~~~~^^
  File "/home/user/Projects/Tauon/.buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py", line 677, in __init__
    getattr(self, command)(args)
    ~~~~~~~~~~~~~~~~~~~~~~^^^^^^
  File "/home/user/Projects/Tauon/.buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py", line 104, in wrapper_func
    build_dist_from_args(ctx, dist, args)
    ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
  File "/home/user/Projects/Tauon/.buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py", line 163, in build_dist_from_args
    build_recipes(build_order, python_modules, ctx,
    ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                  getattr(args, "private", None),
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ...<2 lines>...
                  ),
                  ^^
                 )
                 ^
  File "/home/user/Projects/Tauon/.buildozer/android/platform/python-for-android/pythonforandroid/build.py", line 517, in build_recipes
    recipe.build_arch(arch)
    ~~~~~~~~~~~~~~~~~^^^^^^
  File "/home/user/Projects/Tauon/.buildozer/android/platform/python-for-android/pythonforandroid/recipe.py", line 1340, in build_arch
    self.install_wheel(arch, built_wheels)
    ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^
  File "/home/user/Projects/Tauon/.buildozer/android/platform/python-for-android/pythonforandroid/recipe.py", line 1283, in install_wheel
    from wheel.cli.tags import tags as wheel_tags
ModuleNotFoundError: No module named 'wheel.cli'

EDIT: Worked around with an LLM:

    def _retag_wheel_platform(self, path, new_platform_tag, remove_old=True):
        """
        Rename a wheel by replacing only its platform tag.

        Wheel filename format:
          {dist}-{version}(-{build})?-{python tag}-{abi tag}-{platform tag}.whl

        We split from the right so project names/build tags containing '-' still work.
        """
        p = Path(path)
        if p.suffix != ".whl":
            raise ValueError(f"Not a wheel: {path}")

        parts = p.stem.rsplit("-", 3)
        if len(parts) != 4:
            raise ValueError(f"Unexpected wheel filename format: {p.name}")

        left, py_tag, abi_tag, _old_platform_tag = parts
        new_name = f"{left}-{py_tag}-{abi_tag}-{new_platform_tag}.whl"
        new_path = p.with_name(new_name)

        if new_path != p:
            p.rename(new_path)
            if not remove_old and new_path != p:
                # rename already removed old path, so if you truly want both,
                # copy instead of rename
                pass

        return str(new_path)

    def install_wheel(self, arch, built_wheels):
        with patch_wheel_setuptools_logging():
            from wheel.wheelfile import WheelFile

        _wheel = built_wheels[0]
        built_wheel_dir = dirname(_wheel)

        selected_wheel = self._retag_wheel_platform(
            _wheel,
            self.get_wheel_platform_tag(arch),
            remove_old=True,
        )

        _dev_wheel_dir = environ.get("P4A_WHEEL_DIR", False)
        if _dev_wheel_dir:
            ensure_dir(_dev_wheel_dir)
            shprint(sh.cp, selected_wheel, _dev_wheel_dir)

        info(f"Installing built wheel: {basename(selected_wheel)}")
        destination = self.ctx.get_python_install_dir(arch.arch)
        with WheelFile(selected_wheel) as wf:
            for zinfo in wf.filelist:
                wf.extract(zinfo, destination)
Ngôn ngữ chính
Python
Star
8.9k
Fork
2k
Merge trung bình
3 ngày 12 giờ
Pull request đã merge (30 ngày)
8

Chuẩn bị môi trường

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.

Issue khác của kivy/python-for-android

Tất cả issue của kivy/python-for-android

Issue tương tự

Thêm issue về Python

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.