From 2c1ae5e61c18c63760a66be08840b464068c50f3 Mon Sep 17 00:00:00 2001 From: sergioahp Date: Fri, 16 Jan 2026 04:53:09 -0600 Subject: [PATCH] python3Packages.pytensor: add setuptools runtime dependency PyTensor imports setuptools at runtime during JIT/C compilation: - pytensor/link/c/cmodule.py imports setuptools._distutils.sysconfig - pytensor/link/c/exceptions.py imports setuptools.errors Upstream declares setuptools>=59.0.0 in dependencies: https://github.com/pymc-devs/pytensor/blob/a314476f233f2c771a1f9d75ddf4959dbb2d5646/pyproject.toml#L50 Without this, python3.withPackages environments fail at runtime with: ModuleNotFoundError: No module named 'setuptools' Fixes runtime import errors when using pytensor or packages that depend on it (e.g., pymc). --- pkgs/development/python-modules/pytensor/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/development/python-modules/pytensor/default.nix b/pkgs/development/python-modules/pytensor/default.nix index 2180cb70247f..c989e510ec86 100644 --- a/pkgs/development/python-modules/pytensor/default.nix +++ b/pkgs/development/python-modules/pytensor/default.nix @@ -61,6 +61,7 @@ buildPythonPackage rec { numba numpy scipy + setuptools ]; nativeCheckInputs = [