1{ lib, stdenv, buildPythonPackage, fetchPypi 2, gfortran, glibcLocales 3, numpy, scipy, pytest, pillow 4}: 5 6# 0.20.x is the last version that maintains python2 compatibility 7 8buildPythonPackage rec { 9 pname = "scikit-learn"; 10 version = "0.20.4"; 11 # UnboundLocalError: local variable 'message' referenced before assignment 12 disabled = stdenv.isi686; # https://github.com/scikit-learn/scikit-learn/issues/5534 13 14 src = fetchPypi { 15 inherit pname version; 16 sha256 = "1z3w2c50dwwa297j88pr16pyrjysagsvdj7vrlq40q8777rs7a6z"; 17 }; 18 19 nativeBuildInputs = [ gfortran ]; 20 buildInputs = [ pillow glibcLocales ]; 21 propagatedBuildInputs = [ numpy scipy numpy.blas ]; 22 checkInputs = [ pytest ]; 23 24 LC_ALL="en_US.UTF-8"; 25 26 doCheck = !stdenv.isAarch64; 27 # Skip test_feature_importance_regression - does web fetch 28 checkPhase = '' 29 cd $TMPDIR 30 HOME=$TMPDIR OMP_NUM_THREADS=1 pytest -k "not test_feature_importance_regression" --pyargs sklearn 31 ''; 32 33 meta = with lib; { 34 description = "A set of python modules for machine learning and data mining"; 35 homepage = "https://scikit-learn.org"; 36 license = licenses.bsd3; 37 maintainers = with maintainers; [ ]; 38 }; 39}