MacOS 安装 ddddocr 报错

当我使用mac安装ddddocr时显示:

uv add ddddocr 
Resolved 10 packages in 617ms
error: Distribution `onnxruntime==1.25.0 @ registry+https://pypi.org/simple` can't be installed because it doesn't have a source distribution or wheel for the current platform

hint: You're on macOS (`macosx_26_0_x86_64`), but `onnxruntime` (v1.25.0) only has wheels for the following platforms: `manylinux_2_27_aarch64`, `manylinux_2_27_x86_64`, `manylinux_2_28_aarch64`, `manylinux_2_28_x86_64`, `macosx_14_0_arm64`, `win_amd64`, `win_arm64`; consider adding "sys_platform == 'darwin' and platform_machine == 'x86_64'" to `tool.uv.required-environments` to ensure uv resolves to a version with compatible wheels

这是因为当前的平台被识别为 macosx_26_0_x86_64,而 onnxruntime v1.25.0 的预编译包支持 macosx_14_0_arm64 (Apple Silicon),但没有为 Intel 芯片的 Mac 提供 x86_64 版本

解决方法:

pyproject.toml 文件,添加以下配置:

[tool.uv]
required-environments = [
    "sys_platform == 'darwin' and platform_machine == 'x86_64'"
]

评论

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注