首页 前端知识 Python|Windows 系统安装 triton 的方法

Python|Windows 系统安装 triton 的方法

2025-02-25 13:02:32 前端知识 前端哥 416 73 我要收藏

问题现象

若未安装,则在运行调用了该仓库的 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

在这里插入图片描述

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

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

在这里插入图片描述

后续问题

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

ModuleNotFoundError: No module named 'triton.common'

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

转载请注明出处或者链接地址:https://www.qianduange.cn//article/21474.html
标签
评论
发布的文章

python调用ollama库详解

2025-02-25 13:02:30

大家推荐的文章
会员中心 联系我 留言建议 回顶部
复制成功!