StabilityMatrix icon indicating copy to clipboard operation
StabilityMatrix copied to clipboard

Fresh ComfyUI with Triton & Sage Attention Installation failure

Open LesPles opened this issue 3 months ago • 7 comments

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

LesPles avatar Sep 29 '25 16:09 LesPles

Same problem here, windows 11, fresh install

b4nn3d avatar Oct 05 '25 10:10 b4nn3d

same issue with FramePack in Linux

shalim2904 avatar Oct 06 '25 02:10 shalim2904

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

james-banks avatar Oct 20 '25 15:10 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:

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)

s3to87 avatar Nov 13 '25 17:11 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:

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

setx SETUPTOOLS_USE_DISTUTILS "local"

james-banks avatar Nov 13 '25 18:11 james-banks

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.

mohnjiles avatar Nov 13 '25 19:11 mohnjiles

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

s3to87 avatar Nov 13 '25 20:11 s3to87

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.

Sylus094 avatar Dec 06 '25 17:12 Sylus094