shankarpandala / lazypredict

Lazy Predict help build a lot of basic models without much code and helps understand which models works better without any parameter tuning
MIT License
2.78k stars 321 forks source link

Import LazyRegressor - AttributeError: 'NoneType' object has no attribute 'split' #391

Open SSMK-wq opened 1 year ago

SSMK-wq commented 1 year ago

Describe the bug Unable to import the Lazy predict Regressor

To Reproduce Steps to reproduce the behavior:

  1. import lazypredict
  2. from lazypredict.Supervised import LazyRegressor # throws error in this line as shown below

Expected behavior Lazy Regressor should be imported successfully

Screenshots See below

Desktop (please complete the following information):


AttributeError Traceback (most recent call last) Input In [16], in <cell line: 1>() ----> 1 from lazypredict.Supervised import LazyRegressor

File ~\AppData\Roaming\Python\Python39\site-packages\lazypredict\Supervised.py:73, in 36 removed_classifiers = [ 37 "ClassifierChain", 38 "ComplementNB", (...) 50 "VotingClassifier", 51 ] 53 removed_regressors = [ 54 "TheilSenRegressor", 55 "ARDRegression", (...) 68 "VotingRegressor", 69 ] 71 CLASSIFIERS = [ 72 est ---> 73 for est in all_estimators() 74 if (issubclass(est[1], ClassifierMixin) and (est[0] not in removed_classifiers)) 75 ] 77 REGRESSORS = [ 78 est 79 for est in all_estimators() 80 if (issubclass(est[1], RegressorMixin) and (est[0] not in removed_regressors)) 81 ] 83 REGRESSORS.append(("XGBRegressor", xgboost.XGBRegressor))

File ~\Anaconda3\lib\site-packages\sklearn\utils__init__.py:1174, in all_estimators(type_filter) 1151 """Get a list of all estimators from sklearn. 1152 1153 This function crawls the module and gets all classes that inherit (...) 1171 and class is the actual type of the class. 1172 """ 1173 # lazy import to avoid circular imports from sklearn.base -> 1174 from ._testing import ignore_warnings 1175 from ..base import ( 1176 BaseEstimator, 1177 ClassifierMixin, (...) 1180 ClusterMixin, 1181 ) 1183 def is_abstract(c):

File ~\Anaconda3\lib\site-packages\sklearn\utils_testing.py:532, in 527 skip_travis = pytest.mark.skipif( 528 os.environ.get("TRAVIS") == "true", reason="skip on travis" 529 ) 530 fails_if_pypy = pytest.mark.xfail(IS_PYPY, reason="not compatible with PyPy") 531 fails_if_unstable_openblas = pytest.mark.xfail( --> 532 _in_unstable_openblas_configuration(), 533 reason="OpenBLAS is unstable for this configuration", 534 ) 535 skip_if_no_parallel = pytest.mark.skipif( 536 not joblib.parallel.mp, reason="joblib is in serial mode" 537 ) 539 # Decorator for tests involving both BLAS calls and multiprocessing. 540 # 541 # Under POSIX (e.g. Linux or OSX), using multiprocessing in conjunction (...) 555 # errors on interactively defined functions. It therefore not enabled by 556 # default.

File ~\Anaconda3\lib\site-packages\sklearn\utils__init__.py:93, in _in_unstable_openblas_configuration() 90 import numpy # noqa 91 import scipy # noqa ---> 93 modules_info = threadpool_info() 95 open_blas_used = any(info["internal_api"] == "openblas" for info in modules_info) 96 if not open_blas_used:

File ~\Anaconda3\lib\site-packages\sklearn\utils\fixes.py:162, in threadpool_info() 160 return controller.info() 161 else: --> 162 return threadpoolctl.threadpool_info()

File ~\Anaconda3\lib\site-packages\threadpoolctl.py:124, in threadpool_info() 107 @_format_docstring(USER_APIS=list(_ALL_USER_APIS), 108 INTERNAL_APIS=_ALL_INTERNAL_APIS) 109 def threadpool_info(): 110 """Return the maximal number of threads for each detected library. 111 112 Return a list with all the supported modules that have been found. Each (...) 122 In addition, each module may contain internal_api specific entries. 123 """ --> 124 return _ThreadpoolInfo(user_api=_ALL_USER_APIS).todicts()

File ~\Anaconda3\lib\site-packages\threadpoolctl.py:340, in _ThreadpoolInfo.init(self, user_api, prefixes, modules) 337 self.user_api = [] if user_api is None else user_api 339 self.modules = [] --> 340 self._load_modules() 341 self._warn_if_incompatible_openmp() 342 else:

File ~\Anaconda3\lib\site-packages\threadpoolctl.py:373, in _ThreadpoolInfo._load_modules(self) 371 self._find_modules_with_dyld() 372 elif sys.platform == "win32": --> 373 self._find_modules_with_enum_process_module_ex() 374 else: 375 self._find_modules_with_dl_iterate_phdr()

File ~\Anaconda3\lib\site-packages\threadpoolctl.py:485, in _ThreadpoolInfo._find_modules_with_enum_process_module_ex(self) 482 filepath = buf.value 484 # Store the module if it is supported and selected --> 485 self._make_module_from_path(filepath) 486 finally: 487 kernel_32.CloseHandle(h_process)

File ~\Anaconda3\lib\site-packages\threadpoolctl.py:515, in _ThreadpoolInfo._make_module_from_path(self, filepath) 513 if prefix in self.prefixes or user_api in self.user_api: 514 module_class = globals()[module_class] --> 515 module = module_class(filepath, prefix, user_api, internal_api) 516 self.modules.append(module)

File ~\Anaconda3\lib\site-packages\threadpoolctl.py:606, in _Module.init(self, filepath, prefix, user_api, internal_api) 604 self.internal_api = internal_api 605 self._dynlib = ctypes.CDLL(filepath, mode=_RTLD_NOLOAD) --> 606 self.version = self.get_version() 607 self.num_threads = self.get_num_threads() 608 self._get_extra_info()

File ~\Anaconda3\lib\site-packages\threadpoolctl.py:646, in _OpenBLASModule.get_version(self) 643 get_config = getattr(self._dynlib, "openblas_get_config", 644 lambda: None) 645 get_config.restype = ctypes.c_char_p --> 646 config = get_config().split() 647 if config[0] == b"OpenBLAS": 648 return config[1].decode("utf-8")

AttributeError: 'NoneType' object has no attribute 'split'

jlplenio commented 1 year ago

Don't know what the problem is, but downgrading to Scikit-learn==1.0.2 works.