解决No module named 'triton'的问题

问题描述:
在Windows系统中,pip install triton时会报错:

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

这是因为triton只支持Linux系统。需要安装Triton for Windows

简单方法

pip install cmake
pip install triton-2.0.0-cp310-cp310-win_amd64.whl

具体分析

项目的虚拟环境中进行。

根据GitHub中给的提示,需要输入下面命令:

pip install triton-2.0.0-cp310-cp310-win_amd64.whl

会报错,说找不到triton-2.0.0-cp310-cp310-win_amd64.whl

ERROR: Could not install packages due to an OSError: [Errno 2] No such file or directory: 'D:\\项目路径\\triton-2.0.0-cp310-cp310-win_amd64.whl'

说明要先把triton-2.0.0-cp310-cp310-win_amd64.whl下载到项目路径中。然后再

.\venv\Scripts\python.exe -m pip install triton-2.0.0-cp310-cp310-win_amd64.whl

发现又有报错:

WARNING: Requirement 'cmake-3.26.3-py2.py3-none-win_amd64.whl' looks like a filename, but the file does not exist
Processing d:\semantic_segmentation\sf-mamba\cmake-3.26.3-py2.py3-none-win_amd64.whl
ERROR: Could not install packages due to an OSError: [Errno 2] No such file or directory: 'D:\\项目路径\\cmake-3.26.3-py2.py3-none-win_amd64.whl'

说明需要安装CMake 3.26.3,输入命令,安装一下:

.\venv\Scripts\python.exe -m pip install cmake==3.26.3

现在再用下面的命令安装triton:

.\venv\Scripts\python.exe -m pip install triton-2.0.0-cp310-cp310-win_amd64.whl

可以安装Triton了

posted @ 2024-09-03 17:09  茴香豆的茴  阅读(350)  评论(0编辑  收藏  举报