Fresh ComfyUI with Triton & Sage Attention Installation failure
What happened?
- Clean install of a new ComfyUI Package
- Start package normally, installs dependencies etc. no issues, numerous times
- Stop the package
- From Packages screen, select 3 dots, Package Commands, Install Triton and Sage Attention
- Installation starts, and end in an error - related to "
distutilswas 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_wheelfailed (exit code: 1)
[stderr]
Traceback (most recent call last):
File "
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 "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
Same problem here, windows 11, fresh install
same issue with FramePack in Linux
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
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 "
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 "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)
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"
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.
Downgrading torch to 2.9.0 fixed it for me, thanks for the advice!
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.