Skip to content

SageAttention install error with torch #1396

@Saberloki27

Description

@Saberloki27

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions