Repository navigation
SageAttention install error with torch #1396
Description
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 "", line 14, in
File "J:\Stability Matrix\Data\Assets\uv\cache\builds-v0.tmpK7VuVS\lib\site-packages\setuptools\build_meta.py", line 331, in get_requires_for_build_wheel
return self._get_build_requires(config_settings, requirements=[])
File "J:\Stability Matrix\Data\Assets\uv\cache\builds-v0.tmpK7VuVS\lib\site-packages\setuptools\build_meta.py", line 301, in _get_build_requires
self.run_setup()
File "J:\Stability Matrix\Data\Assets\uv\cache\builds-v0.tmpK7VuVS\lib\site-packages\setuptools\build_meta.py", line 512, in run_setup
super().run_setup(setup_script=setup_script)
File "J:\Stability Matrix\Data\Assets\uv\cache\builds-v0.tmpK7VuVS\lib\site-packages\setuptools\build_meta.py", line 317, in run_setup
exec(code, locals())
File "", line 24, in
ModuleNotFoundError: No module named 'torch'
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 "", line 14, in \n File "J:\Stability Matrix\Data\Assets\uv\cache\builds-v0.tmpK7VuVS\lib\site-packages\setuptools\build_meta.py", line 331, in get_requires_for_build_wheel\n return self._get_build_requires(config_settings, requirements=[])\n File "J:\Stability Matrix\Data\Assets\uv\cache\builds-v0.tmpK7VuVS\lib\site-packages\setuptools\build_meta.py", line 301, in _get_build_requires\n self.run_setup()\n File "J:\Stability Matrix\Data\Assets\uv\cache\builds-v0.tmpK7VuVS\lib\site-packages\setuptools\build_meta.py", line 512, in run_setup\n super().run_setup(setup_script=setup_script)\n File "J:\Stability Matrix\Data\Assets\uv\cache\builds-v0.tmpK7VuVS\lib\site-packages\setuptools\build_meta.py", line 317, in run_setup\n exec(code, locals())\n File "", line 24, in \nModuleNotFoundError: No module named 'torch'\n\nhint: 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.\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
Activity
Mets3D commentedon Sep 23, 2025
I get a different error with the same action, of trying to install triton+sage for comfyui:
PzVI commentedon Sep 24, 2025
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
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 "", line 14, in
File "D:\AI\StabilityMatrix\Assets\uv\cache\builds-v0.tmpwrgZdZ\lib\site-packages\setuptools\build_meta.py", line 331, in get_requires_for_build_wheel
return self._get_build_requires(config_settings, requirements=[])
File "D:\AI\StabilityMatrix\Assets\uv\cache\builds-v0.tmpwrgZdZ\lib\site-packages\setuptools\build_meta.py", line 301, in _get_build_requires
self.run_setup()
File "D:\AI\StabilityMatrix\Assets\uv\cache\builds-v0.tmpwrgZdZ\lib\site-packages\setuptools\build_meta.py", line 512, in run_setup
super().run_setup(setup_script=setup_script)
File "D:\AI\StabilityMatrix\Assets\uv\cache\builds-v0.tmpwrgZdZ\lib\site-packages\setuptools\build_meta.py", line 317, in run_setup
exec(code, locals())
File "", line 24, in
ModuleNotFoundError: No module named 'torch'
hint: This error likely indicates that
file:///D:/AI/StabilityMatrix/Packages/ComfyUI0360/SageAttentiondepends ontorch, but doesn't declare it as a build dependency. Iffile:///D:/AI/StabilityMatrix/Packages/ComfyUI0360/SageAttentionis a first-party package, consider addingtorchto itsbuild-system.requires. Otherwise,uv pip install torchinto 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_wheelfailed (exit code: 1)\n\n[stderr]\nTraceback (most recent call last):\n File "", line 14, in \n File "D:\AI\StabilityMatrix\Assets\uv\cache\builds-v0.tmpwrgZdZ\lib\site-packages\setuptools\build_meta.py", line 331, in get_requires_for_build_wheel\n return self._get_build_requires(config_settings, requirements=[])\n File "D:\AI\StabilityMatrix\Assets\uv\cache\builds-v0.tmpwrgZdZ\lib\site-packages\setuptools\build_meta.py", line 301, in _get_build_requires\n self.run_setup()\n File "D:\AI\StabilityMatrix\Assets\uv\cache\builds-v0.tmpwrgZdZ\lib\site-packages\setuptools\build_meta.py", line 512, in run_setup\n super().run_setup(setup_script=setup_script)\n File "D:\AI\StabilityMatrix\Assets\uv\cache\builds-v0.tmpwrgZdZ\lib\site-packages\setuptools\build_meta.py", line 317, in run_setup\n exec(code, locals())\n File "", line 24, in \nModuleNotFoundError: No module named 'torch'\n\nhint: This error likely indicates thatfile:///D:/AI/StabilityMatrix/Packages/ComfyUI0360/SageAttentiondepends ontorch, but doesn't declare it as a build dependency. Iffile:///D:/AI/StabilityMatrix/Packages/ComfyUI0360/SageAttentionis a first-party package, consider addingtorchto itsbuild-system.requires. Otherwise,uv pip install torchinto the environment and re-run with--no-build-isolation.\n'at StabilityMatrix.Core.Python.UvVenvRunner.PipInstall(ProcessArgs args, Action
1 outputDataReceived) at StabilityMatrix.Core.Models.PackageModification.InstallSageAttentionStep.ExecuteAsync(IProgress1 progress)at StabilityMatrix.Core.Models.PackageModification.InstallSageAttentionStep.ExecuteAsync(IProgress
1 progress) at StabilityMatrix.Core.Models.PackageModification.PackageModificationRunner.ExecuteSteps(IEnumerable1 steps)`
mohnjiles commentedon Oct 19, 2025
This should be fixed in the latest v2.15.2
Nakasara1 commentedon Nov 20, 2025
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.