Skip to content

Fresh ComfyUI with Triton & Sage Attention Installation failure #1400

Open

Description

@LesPles

What happened?

  1. Clean install of a new ComfyUI Package
  2. Start package normally, installs dependencies etc. no issues, numerous times
  3. Stop the package
  4. From Packages screen, select 3 dots, Package Commands, Install Triton and Sage Attention
  5. Installation starts, and end in an error - related to "distutils was removed from the standard library... "

Exception Details

Installing Triton
Using Python 3.12.11 environment at: venv
Resolved 2 packages in 105ms
Installed 1 package in 16ms

  • triton-windows==3.4.0.post20
    Downloading Python libraries
    Download complete!
    Extracting Python libraries
    Downloading SageAttention
    Cloning into 'D:\StabilityMatrix\Data\Packages\ComfyUITritonSage\SageAttention'...
    Installing SageAttention
    Using Python 3.12.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 8, in
File "D:\StabilityMatrix\Data\Assets\uv\cache\builds-v0.tmpJR34Ed\Lib\site-packages\setuptools_init_.py", line 23, in
from . import logging, monkey
File "D:\StabilityMatrix\Data\Assets\uv\cache\builds-v0.tmpJR34Ed\Lib\site-packages\setuptools\logging.py", line 5, in
from . import monkey
File "D:\StabilityMatrix\Data\Assets\uv\cache\builds-v0.tmpJR34Ed\Lib\site-packages\setuptools\monkey.py", line 13, in
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.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 8, in \n File "D:\StabilityMatrix\Data\Assets\uv\cache\builds-v0.tmpJR34Ed\Lib\site-packages\setuptools_init_.py", line 23, in \n from . import logging, monkey\n File "D:\StabilityMatrix\Data\Assets\uv\cache\builds-v0.tmpJR34Ed\Lib\site-packages\setuptools\logging.py", line 5, in \n from . import monkey\n File "D:\StabilityMatrix\Data\Assets\uv\cache\builds-v0.tmpJR34Ed\Lib\site-packages\setuptools\monkey.py", line 13, in \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, 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

v2.15

What Operating System are you using?

Windows

Activity

  1. added
    bugSomething isn't working
    crashBugs involving the app crashing to desktop
    on Sep 29, 2025
  2. b4nn3d commented on Oct 5, 2025

    @b4nn3d

    Same problem here, windows 11, fresh install

  3. shalim2904 commented on Oct 6, 2025

    @shalim2904

    same issue with FramePack in Linux

  4. james-banks commented on Oct 20, 2025

    @james-banks

    I've had similar errors previously caused by trying to install older packages in Python 3.12.

    This is something package maintainers can easily fix, but in lieu of that just set the following environment variable in SM:

    SETUPTOOLS_USE_DISTUTILS=stdlib

    SETUPTOOLS_USE_DISTUTILS=local

  5. s3to87 commented on Nov 13, 2025

    @s3to87

    I got the same issue and have set the environment variable in SM as suggested but unfortunately this did not fix it for me, installation still fails with the same error message:

    Installing Triton
    Using Python 3.12.11 environment at: venv
    Audited 1 package in 2ms
    Downloading Python libraries
    Installing SageAttention
    Using Python 3.12.11 environment at: venv
    error: The build backend returned an error
    Caused by: Call to setuptools.build_meta.build_wheel failed (exit code: 1)

    [stderr]
    Traceback (most recent call last):
    File "", line 8, in
    File "D:\Programme\StabilityMatrix\Data\Assets\uv\cache\builds-v0.tmpuRDE6p\Lib\site-packages\setuptools_init_.py", line 24, in
    from . import logging, monkey
    File "D:\Programme\StabilityMatrix\Data\Assets\uv\cache\builds-v0.tmpuRDE6p\Lib\site-packages\setuptools\logging.py", line 5, in
    from . import monkey
    File "D:\Programme\StabilityMatrix\Data\Assets\uv\cache\builds-v0.tmpuRDE6p\Lib\site-packages\setuptools\monkey.py", line 13, in
    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.11 environment at: venv\nerror: The build backend returned an error\n Caused by: Call to setuptools.build_meta.build_wheel failed (exit code: 1)\n\n[stderr]\nTraceback (most recent call last):\n File "", line 8, in \n File "D:\Programme\StabilityMatrix\Data\Assets\uv\cache\builds-v0.tmpuRDE6p\Lib\site-packages\setuptools_init_.py", line 24, in \n from . import logging, monkey\n File "D:\Programme\StabilityMatrix\Data\Assets\uv\cache\builds-v0.tmpuRDE6p\Lib\site-packages\setuptools\logging.py", line 5, in \n from . import monkey\n File "D:\Programme\StabilityMatrix\Data\Assets\uv\cache\builds-v0.tmpuRDE6p\Lib\site-packages\setuptools\monkey.py", line 13, in \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, 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)

  6. james-banks commented on Nov 13, 2025

    @james-banks

    I got the same issue and have set the environment variable in SM as suggested but unfortunately this did not fix it for me, installation still fails with the same error message:

    Apologies, I had the wrong suggestion above - you want to set it to local instead. E.g. via Powershell:

    setx SETUPTOOLS_USE_DISTUTILS "local"

  7. mohnjiles commented on Nov 13, 2025

    @mohnjiles
    Member

    Sorry, seems that torch updated to 2.9.1 and there isn't a corresponding pre-built wheel for that version yet. Will get an update out when it exists; in the meantime you can rollback to v2.9.0 of torch for the "easy-button" to work properly.

  8. s3to87 commented on Nov 13, 2025

    @s3to87

    Downgrading torch to 2.9.0 fixed it for me, thanks for the advice!

  9. Sylus094 commented on Dec 6, 2025

    @Sylus094

    Downgrading torch to 2.9.0 fixed it for me, thanks for the advice!

    Downgrade to 2.9.0 fixed my same issue as well, as for now.

  10. added a commit that references this issue on Sep 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingcrashBugs involving the app crashing to desktop

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions