diff --git a/pkgs/development/python-modules/scikitlearn/default.nix b/pkgs/development/python-modules/scikitlearn/default.nix index e7307c926320..7e9e37831e0d 100644 --- a/pkgs/development/python-modules/scikitlearn/default.nix +++ b/pkgs/development/python-modules/scikitlearn/default.nix @@ -3,25 +3,38 @@ , buildPythonPackage , fetchPypi , fetchpatch -, gfortran, glibcLocales -, numpy, scipy, pytest, pillow +, gfortran +, glibcLocales +, numpy +, scipy +, pytest +, pillow , cython , joblib , llvmPackages , threadpoolctl +, pythonOlder }: buildPythonPackage rec { pname = "scikit-learn"; version = "0.24.1"; - # UnboundLocalError: local variable 'message' referenced before assignment - disabled = stdenv.isi686; # https://github.com/scikit-learn/scikit-learn/issues/5534 + disabled = pythonOlder "3.6"; src = fetchPypi { inherit pname version; sha256 = "oDNKGALmTWVgIsO/q1anP71r9LEpg0PzaIryFRgQu98="; }; + patches = [ + # This patch fixes compatibility with numpy 1.20. It was merged before 0.24.1 was released, + # but for some reason was not included in the 0.24.1 release tarball. + (fetchpatch { + url = "https://github.com/scikit-learn/scikit-learn/commit/e7ef22c3ba2334cb3b476e95d7c083cf6b48ce56.patch"; + sha256 = "174554k1pbf92bj7wgq0xjj16bkib32ailyhwavdxaknh4bd9nmv"; + }) + ]; + buildInputs = [ pillow gfortran