Repository navigation
ComfyUI install on Python 3.13 fails: ExtraPipArgs "numpy<2" is unsatisfiable (numpy 1.26.4 has no cp313 wheels) #1754
Description
Package
ComfyUI
When did the issue occur?
Installing the Package
What GPU / hardware type are you using?
NVIDIA RTX 5090 (sm_120), driver 616.56, Windows 11.
Not GPU-specific — this reproduces for any CUDA / CPU / XPU install on Python 3.13, because the failing step is the pure-Python dependency resolve, before any CUDA-specific work happens.
What happened?
Selecting Python 3.13 for a new ComfyUI install cannot complete. Stability Matrix installs Python 3.13.15 with uv, creates the venv against it correctly, and then the first pip pass fails. On the retry SM silently falls back to its recommended Python 3.12, so the install eventually reports success on the wrong interpreter (and the package is recorded as "PythonVersion": "3.12.14" in settings.json).
Root cause — StabilityMatrix.Core/Models/Packages/ComfyUI.cs:527:
var config = new PipInstallConfig
{
RequirementsFilePaths = ["requirements.txt"],
ExtraPipArgs = ["numpy<2"], // <-- unsatisfiable on Python 3.13
TorchaudioVersion = " ", // Request torchaudio without a specific version
CudaIndex = isLegacyNvidia ? "cu126" : "cu130",
RocmIndex = "rocm7.2",
XpuIndex = "xpu",
UpgradePackages = true,
PostInstallPipArgs = ["typing-extensions>=4.15.0"],
};numpy<2 resolves to numpy 1.26.4, the last 1.x release. numpy 1.26.4 predates Python 3.13 and publishes zero cp313 wheels — verified against the PyPI JSON API (https://pypi.org/pypi/numpy/1.26.4/json): it ships cp312 wheels and none for cp313; the first numpy release with a cp313-win_amd64 wheel is 2.1.0.
The pin forces 1.26.4 exactly, because it intersects with scipy's floor: numpy<2 ∩ scipy>=1.26.4 (scipy 1.17.1 declares numpy<2.7,>=1.26.4) → numpy==1.26.4.
With no wheel available, uv falls back to a meson source build of 1.26.4, which fails and aborts the whole install (full output in the Console output section below).
The pin is also vestigial. Immediately after the requirements pass, StandardPipInstallProcessAsync runs the CUDA torch step — uv pip install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu130 --upgrade --force-reinstall. That step resolves numpy 2.x regardless: in the same install that succeeded on Python 3.12, numpy ended at 2.5.2. So on Python 3.12 the pin has no observable effect, and on Python 3.13 its only observable effect is to break the resolve.
Nothing in the stack requires numpy<2. Every installed distribution's declared requirements were scanned; the only numpy constraints are:
| package | constraint |
|---|---|
comfyui (requirements.txt) |
numpy>=1.25.0 |
scipy 1.17.1 |
numpy<2.7,>=1.26.4 |
kornia 0.8.3 |
numpy<3 |
networkx 3.6.1 |
numpy>=1.25 |
transformers 5.17.0 |
numpy>=1.17 |
torchsde 0.2.6 |
numpy>=1.19 |
No package declares an upper bound below 3.
History / why this is stale: the pin was added in 2024 for the numpy 2.0 ABI break — dcadcb35 (2024-06-17) "Add pinned numpy and mpmath for comfy install", then 99274e6c / PR #779, in response to issue #691. At that time torch/torchvision were built against numpy 1.x. That is no longer the case for what SM installs today. Notably, the closing analysis in #691 already identified the correct fix — install torch from the torch index first, then ComfyUI's requirements.txt separately — which SM has since adopted as the two-step install. The pin outlived its reason.
What we want the fix to be
Preferred — remove the pin (ComfyUI.cs:527):
var config = new PipInstallConfig
{
RequirementsFilePaths = ["requirements.txt"],
- ExtraPipArgs = ["numpy<2"],
TorchaudioVersion = " ", // Request torchaudio without a specific versionRationale: current ComfyUI requires only numpy>=1.25.0; SM's own torch step already upgrades numpy past the pin; and numpy 2.x is what a stock ComfyUI environment ends up on regardless. Removing it unblocks Python 3.13 and changes nothing on 3.12.
Alternative — gate the pin to interpreters where it can be satisfied:
// numpy 1.x has no wheels for Python 3.13+
if (PyVersion.Parse(installedPackage.PythonVersion) < new PyVersion(3, 13))
{
config.ExtraPipArgs = ["numpy<2"];
}This keeps the historical behaviour for the legacy Python 3.10/3.12 paths while allowing 3.13.
Also worth considering: ComfyUI.cs:59 still pins RecommendedPythonVersion => PyInstallationManager.Python_3_12_10. Once the pin above is gone, 3.13 should install cleanly, so the recommendation could be raised — or at minimum, a user-selected newer Python should not be silently reverted to 3.12 by the fallback retry.
Workaround used here (in case it helps anyone triaging): build the venv manually, bypassing SM's pip config — uv venv --python 3.13.15 …, then uv pip install -r requirements.txt, then uv pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu130, then set "PythonVersion": "3.13.15" in settings.json. The resulting environment boots ComfyUI 0.37.0 fine on 3.13.15 with torch 2.14.0+cu130 and numpy 2.5.2. The problem is only that SM re-runs its own install (with the pin) on the next package update, which re-breaks it.
Console output
Attempt with Python 3.13.15 (fails):
2026-09-24 04:24:27.9596|INFO |StabilityMatrix.Core.Python.PyInstallationManager|Python 3.13.15 not found. Attempting to install with UV.
2026-09-24 04:24:27.9596|DEBUG|StabilityMatrix.Core.Processes.ProcessRunner|Starting process '...\uv.exe' with arguments 'python install 3.13.15'
2026-09-24 04:24:32.0898|INFO |StabilityMatrix.Core.Python.UvManager|Verified install via GetInstalledPythonAsync: 3.13.15 at D:\AI\Data\Assets\Python\cpython-3.13.15-windows-x86_64-none
2026-09-24 04:24:54.6919|DEBUG|StabilityMatrix.Core.Processes.ProcessRunner|Starting process '...\uv.exe' with arguments 'venv D:\AI\Data\Packages\ComfyUI\venv --allow-existing --python D:\AI\Data\Assets\Python\cpython-3.13.15-windows-x86_64-none\python.exe' in working directory 'D:\AI\Data\Packages\ComfyUI'
2026-09-24 04:24:55.1528|DEBUG|StabilityMatrix.Core.Python.UvVenvRunner|Pip output: Using Python 3.13.15 environment at: venv
...
2026-09-24 04:28:18.2131|DEBUG|StabilityMatrix.Core.Python.UvVenvRunner|Pip output: × Failed to build `numpy==1.26.4`
2026-09-24 04:28:18.2131|DEBUG|StabilityMatrix.Core.Python.UvVenvRunner|Pip output: ├─▶ The build backend returned an error
2026-09-24 04:28:18.2500|DEBUG|StabilityMatrix.Core.Python.UvVenvRunner|Pip output: ╰─▶ Call to `mesonpy.build_wheel` failed (exit code: 1)
2026-09-24 04:28:18.2500|DEBUG|StabilityMatrix.Core.Python.UvVenvRunner|Pip output: [stdout]
2026-09-24 04:28:18.2500|DEBUG|StabilityMatrix.Core.Python.UvVenvRunner|Pip output: + D:\AI\Data\Assets\uv\cache\builds-v0\.tmpGXDYQ7\Scripts\python.exe
2026-09-24 04:28:18.2500|DEBUG|StabilityMatrix.Core.Python.UvVenvRunner|Pip output: ...\vendored-meson\meson\meson.py setup ... -Dbuildtype=release -Db_ndebug=if-release -Db_vscrt=md
2026-09-24 04:28:18.4556|ERROR|StabilityMatrix.Avalonia.Extensions.NotificationServiceExtensions|Error Installing Package|StabilityMatrix.Core.Exceptions.ProcessException: pip install failed with code 1: 'Using Python 3.13.15 environment at: venv
Resolved 85 packages in 1.80s
Downloading pygments (1.2MiB)
...
Retry, silently falling back to Python 3.12.14 (succeeds):
2026-09-24 04:38:49.7774|INFO |StabilityMatrix.Core.Python.PyInstallationManager|Python 3.12.14 not found. Attempting to install with UV.
2026-09-24 04:38:58.3948|DEBUG|StabilityMatrix.Core.Processes.ProcessRunner|Starting process '...\uv.exe' with arguments 'venv D:\AI\Data\Packages\ComfyUI\venv --allow-existing --python D:\AI\Data\Assets\Python\cpython-3.12.14-windows-x86_64-none\python.exe'
2026-09-24 04:38:58.8042|DEBUG|StabilityMatrix.Core.Python.UvVenvRunner|Pip output: Using Python 3.12.14 environment at: venv
...
2026-09-24 04:39:21.1824|DEBUG|StabilityMatrix.Core.Python.UvVenvRunner|Pip output: + numpy==1.26.4 <-- cp312 wheel exists, so the pin is satisfiable here
...
2026-09-24 04:40:17.0604|DEBUG|StabilityMatrix.Core.Python.UvVenvRunner|Pip output: + numpy==2.5.2 <-- SM's own torch step upgrades past the pin
Resulting (3.12) environment, for reference — the pin did not hold:
python : 3.12.14
torch : 2.14.0+cu130
cuda : 13.0 | avail: True
gpu : NVIDIA GeForce RTX 5090 (12, 0)
numpy : 2.5.2
Version
v2.16.4
What Operating System are you using?
Windows
Issue identified by @nmorgowicz. Root-cause investigation, log and PyPI validation, and write-up produced with deepseek-v4.1-flash running in oh-my-pi.
Activity