Python|Windows 系统安装 triton 的方法

07-19 1678阅读

问题现象

若未安装,则在运行调用了该仓库的 Python 脚本时,会报错如下:

ModuleNotFoundError: No module named 'triton'

在 Windows 系统中,如果直接使用 pip 安装,会报错如下:

pip install triton
ERROR: Could not find a version that satisfies the requirement triton (from versions: none)
ERROR: No matching distribution found for triton

这是因为 pypi 中的 triton 中没有适用于 Python 的版本。

解决方法

Step 1|在 HuggingFace 上下载 triton 的 Windows 包:https://hf-mirror.com/madbuda/triton-windows-builds

Python|Windows 系统安装 triton 的方法

Step 2|在下载路径下 pip install 安装 whl 文件即可:

pip install triton-2.1.0-cp311-cp311-win_amd64.whl

Python|Windows 系统安装 triton 的方法

后续问题

如果继续抛出如下异常,可能是版本不匹配,暂未找到合适的解决方法。

ModuleNotFoundError: No module named 'triton.common'

如果在 unsloth 用到,那么通常因为 unsloth 通常是用来显卡加速的,可以尝试暂时卸载 unsloth 解决。

VPS购买请点击我

文章版权声明:除非注明,否则均为主机测评原创文章,转载或复制请以超链接形式并注明出处。

目录[+]