Repository navigation
Fresh ComfyUI with Triton & Sage Attention Installation failure #1400
Description
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 tosetuptools.build_meta:__legacy__.build_wheelfailed (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
b4nn3d commentedon Oct 5, 2025
Same problem here, windows 11, fresh install
shalim2904 commentedon Oct 6, 2025
same issue with FramePack in Linux
james-banks commentedon Oct 20, 2025
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=stdlibSETUPTOOLS_USE_DISTUTILS=locals3to87 commentedon Nov 13, 2025
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_wheelfailed (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:
distutilswas removed from the standard library in Python 3.12. Consider adding a constraint to avoid building a package that depends ondistutils.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_wheelfailed (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:distutilswas removed from the standard library in Python 3.12. Consider adding a constraint to avoid building a package that depends ondistutils.\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)james-banks commentedon Nov 13, 2025
Apologies, I had the wrong suggestion above - you want to set it to
localinstead. E.g. via Powershell:setx SETUPTOOLS_USE_DISTUTILS "local"mohnjiles commentedon Nov 13, 2025
Sorry, seems that
torchupdated 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.s3to87 commentedon Nov 13, 2025
Downgrading torch to 2.9.0 fixed it for me, thanks for the advice!
Sylus094 commentedon Dec 6, 2025
Downgrade to 2.9.0 fixed my same issue as well, as for now.
Merge pull request LykosAI#1400 from ionite34/fix/env-var-user-override