百科.dev
全部条目AI 编程趋势榜开源项目技术资讯提交条目
登录
返回工具页/返回 Issues 列表
#3293·python-for-android

ModuleNotFoundError: 没有名为 'wheel.cli' 的模块

作者: C0rn3j创建于 2026年3月15日更新于 2026年4月18日
标签Priority: Loweasy

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)

内容来源: kivy/python-for-android

查看 GitHub 原文在 GitHub 查看讨论