SageAttention install error with torch
Package
Package Commands > Install Triton and SageAttention
When did the issue occur?
Installing the Package
What GPU / hardware type are you using?
rtx 4090
What happened?
Installing triton and sageattention on comfyui with Package Commands.
I have torch 2.8.0+cu129 in the Python Packages and comfyui is functioning properly.
pip list result in the venv is "torch 2.8.0+cu129".
The install fail with the following error:
ModuleNotFoundError: No module named 'torch'
Console output
Downloading Python libraries
Downloading SageAttention
Cloning into 'J:\Stability Matrix\Data\Packages\ComfyUI\SageAttention'...
Installing SageAttention
Using Python 3.10.11 environment at: venv
error: The build backend returned an error
Caused by: Call to setuptools.build_meta:__legacy__.build_wheel failed (exit code: 1)
[stderr]
Traceback (most recent call last):
File "
hint: This error likely indicates that file:///J:/Stability%20Matrix/Data/Packages/ComfyUI/SageAttention depends on torch, but doesn't declare it as a build dependency. If file:///J:/Stability%20Matrix/Data/Packages/ComfyUI/SageAttention is a first-party package, consider adding torch to its build-system.requires. Otherwise, uv pip install torch into the environment and re-run with --no-build-isolation.
Error: StabilityMatrix.Core.Exceptions.ProcessException: pip install failed with code 2: 'Using Python 3.10.11 environment at: venv\nerror: The build backend returned an error\n Caused by: Call to setuptools.build_meta:__legacy__.build_wheel failed (exit code: 1)\n\n[stderr]\nTraceback (most recent call last):\n File "file:///J:/Stability%20Matrix/Data/Packages/ComfyUI/SageAttention depends on torch, but doesn't declare it as a build dependency. If file:///J:/Stability%20Matrix/Data/Packages/ComfyUI/SageAttention is a first-party package, consider adding torch to its build-system.requires. Otherwise, uv pip install torch into the environment and re-run with --no-build-isolation.\n'
at StabilityMatrix.Core.Python.UvVenvRunner.PipInstall(ProcessArgs args, Action1 outputDataReceived) at StabilityMatrix.Core.Models.PackageModification.InstallSageAttentionStep.ExecuteAsync(IProgress1 progress)
at StabilityMatrix.Core.Models.PackageModification.InstallSageAttentionStep.ExecuteAsync(IProgress1 progress) at StabilityMatrix.Core.Models.PackageModification.PackageModificationRunner.ExecuteSteps(IEnumerable1 steps)
Version
2.15.0
What Operating System are you using?
Windows
I get a different error with the same action, of trying to install triton+sage for comfyui:
Using Python 3.12.10 environment at: venv
error: The build backend returned an error
Caused by: Call to `setuptools.build_meta:__legacy__.build_wheel` failed (exit code: 1)
[stderr]
Traceback (most recent call last):
File "<string>", line 8, in <module>
File "F:\StableDiffusion\Programs\StabilityMatrix\Data\Assets\uv\cache\builds-v0\.tmpRG3FMK\Lib\site-packages\setuptools\__init__.py", line 23, in <module>
from . import logging, monkey
File "F:\StableDiffusion\Programs\StabilityMatrix\Data\Assets\uv\cache\builds-v0\.tmpRG3FMK\Lib\site-packages\setuptools\logging.py", line 5, in <module>
from . import monkey
File "F:\StableDiffusion\Programs\StabilityMatrix\Data\Assets\uv\cache\builds-v0\.tmpRG3FMK\Lib\site-packages\setuptools\monkey.py", line 13, in <module>
import distutils.filelist
ModuleNotFoundError: No module named 'distutils'
hint: `distutils` was removed from the standard library in Python 3.12. Consider adding a constraint to avoid building a package that depends on `distutils`.
Error: StabilityMatrix.Core.Exceptions.ProcessException: pip install failed with code 2: 'Using Python 3.12.10 environment at: venv\nerror: The build backend returned an error\n Caused by: Call to `setuptools.build_meta:__legacy__.build_wheel` failed (exit code: 1)\n\n[stderr]\nTraceback (most recent call last):\n File "<string>", line 8, in <module>\n File "F:\StableDiffusion\Programs\StabilityMatrix\Data\Assets\uv\cache\builds-v0\.tmpRG3FMK\Lib\site-packages\setuptools\__init__.py", line 23, in <module>\n from . import logging, monkey\n File "F:\StableDiffusion\Programs\StabilityMatrix\Data\Assets\uv\cache\builds-v0\.tmpRG3FMK\Lib\site-packages\setuptools\logging.py", line 5, in <module>\n from . import monkey\n File "F:\StableDiffusion\Programs\StabilityMatrix\Data\Assets\uv\cache\builds-v0\.tmpRG3FMK\Lib\site-packages\setuptools\monkey.py", line 13, in <module>\n import distutils.filelist\nModuleNotFoundError: No module named 'distutils'\n\nhint: `distutils` was removed from the standard library in Python 3.12. Consider adding a constraint to avoid building a package that depends on `distutils`.\n'
at StabilityMatrix.Core.Python.UvVenvRunner.PipInstall(ProcessArgs args, Action`1 outputDataReceived)
at StabilityMatrix.Core.Models.PackageModification.InstallSageAttentionStep.ExecuteAsync(IProgress`1 progress)
at StabilityMatrix.Core.Models.PackageModification.InstallSageAttentionStep.ExecuteAsync(IProgress`1 progress)
at StabilityMatrix.Core.Models.PackageModification.PackageModificationRunner.ExecuteSteps(IEnumerable`1 steps)
the same problem
rtx 3060 windows 10
`Installing Triton Using Python 3.10.11 environment at: venv Resolved 2 packages in 578ms Installed 2 packages in 2.49s
- setuptools==80.9.0
- triton-windows==3.4.0.post20
Downloading Python libraries
Download complete!
Extracting Python libraries
include\internal\pycore_ucnhash.h
Downloading SageAttention
Cloning into 'D:\AI\StabilityMatrix\Packages\ComfyUI0360\SageAttention'...
Installing SageAttention
Using Python 3.10.11 environment at: venv
error: The build backend returned an error
Caused by: Call to
setuptools.build_meta:__legacy__.build_wheelfailed (exit code: 1)
[stderr]
Traceback (most recent call last):
File "
hint: This error likely indicates that file:///D:/AI/StabilityMatrix/Packages/ComfyUI0360/SageAttention depends on torch, but doesn't declare it as a build dependency. If file:///D:/AI/StabilityMatrix/Packages/ComfyUI0360/SageAttention is a first-party package, consider adding torch to its build-system.requires. Otherwise, uv pip install torch into the environment and re-run with --no-build-isolation.
Error: StabilityMatrix.Core.Exceptions.ProcessException: pip install failed with code 2: 'Using Python 3.10.11 environment at: venv\nerror: The build backend returned an error\n Caused by: Call to setuptools.build_meta:__legacy__.build_wheel failed (exit code: 1)\n\n[stderr]\nTraceback (most recent call last):\n File "file:///D:/AI/StabilityMatrix/Packages/ComfyUI0360/SageAttention depends on torch, but doesn't declare it as a build dependency. If file:///D:/AI/StabilityMatrix/Packages/ComfyUI0360/SageAttention is a first-party package, consider adding torch to its build-system.requires. Otherwise, uv pip install torch into the environment and re-run with --no-build-isolation.\n'
at StabilityMatrix.Core.Python.UvVenvRunner.PipInstall(ProcessArgs args, Action1 outputDataReceived) at StabilityMatrix.Core.Models.PackageModification.InstallSageAttentionStep.ExecuteAsync(IProgress1 progress)
at StabilityMatrix.Core.Models.PackageModification.InstallSageAttentionStep.ExecuteAsync(IProgress1 progress) at StabilityMatrix.Core.Models.PackageModification.PackageModificationRunner.ExecuteSteps(IEnumerable1 steps)
`
This should be fixed in the latest v2.15.2
same problem here, sageattention 1.0.6 seemed to "work" but i was not sure. i had troubles with qwen models when using it and i could never update it from stability matrix extension menu. always error message.
when uninstalling it and trying to install, i get the same error, no "torch" installed, but also 2.8.0+cu129 and mostly working normally.