You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

M1 Mac因缺失平台标签导致pip无法安装torch等Python包

pip安装torch失败:兼容标签不匹配问题

近期通过pip安装Python包时遇到问题,以安装torch为例,执行安装命令后失败,报错信息如下:

> arch
arm64
> python --version
3.10.12
❯ pip --version                                                         
pip 23.2.1 from /Users/vinayvaddiparthi/repos/makemore/.venv/lib/python3.10/site-packages/pip (python 3.10)
> python -m venv .venv
> source .venv/bin/activate
> pip install torch                                                        
ERROR: Could not find a version that satisfies the requirement torch (from versions: none)
ERROR: No matching distribution found for torch

使用pip install -vv torch开启verbose模式后,发现pip跳过所有可用wheel,原因是无匹配的系统兼容标签,示例日志如下:

Skipping link: none of the wheel's tags (cp310-none-macosx_10_9_x86_64) are compatible (run pip debug --verbose to show compatible tags): https://files.pythonhosted.org/packages/2e/27/5c912ccc490ec78585cd463198e80be27b53db77f02e7398b41305606399/torch-2.0.1-cp310-none-macosx_10_9_x86_64.whl (from https://pypi.org/simple/torch/) (requires-python:>=3.8.0)
  Skipping link: none of the wheel's tags (cp310-none-macosx_11_0_arm64) are compatible (run pip debug --verbose to show compatible tags): https://files.pythonhosted.org/packages/5a/77/778954c0aad4f7901a1ba02a129bca7467c64a19079108e6b1d6ce8ae575/torch-2.0.1-cp310-none-macosx_11_0_arm64.whl (from https://pypi.org/simple/torch/) (requires-python:>=3.8.0)

所有版本的torch均出现类似日志。

执行pip debug --verbose并过滤相关内容后,输出如下:

❯ pip debug verbose | grep -i -E "macosx|cp310"                            
WARNING: This command is only meant for debugging. Do not use this with automation for parsing and getting these details, since the output and options of this command may change without notice.
  cp310-cp310-macosx_10_16_arm64
  cp310-cp310-macosx_10_16_universal2
  cp310-cp310-macosx_10_15_arm64
  cp310-cp310-macosx_10_15_universal2
  cp310-cp310-macosx_10_14_arm64
  cp310-cp310-macosx_10_14_universal2
  cp310-cp310-macosx_10_13_arm64
  cp310-cp310-macosx_10_13_universal2
  cp310-cp310-macosx_10_12_arm64
  cp310-cp310-macosx_10_12_universal2

发现兼容列表中缺失macosx_11_0_arm64标签,这应该是pip无法安装对应wheel的原因,尽管该wheel在PyPI上是可用的。目前不清楚如何让该标签出现在兼容列表中。

使用pyenv管理Python环境,不确定是否因此引发问题。

MacOS详细信息:

❯ sw_vers                                                                 
ProductName:        macOS
ProductVersion:     13.5
BuildVersion:       22G74

内容的提问来源于stack exchange,提问作者Vinay

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.13 03:26:14