From b1ece525154ac99e684e0bc2987c703ecbba5224 Mon Sep 17 00:00:00 2001 From: Joe Date: Fri, 30 Sep 2022 12:05:26 +0100 Subject: [PATCH] Bug fix: Since python 3.10, the Sequence class of collections is now found at collections.abc. The fix is to check the python version and import from the correct location. --- mlens/externals/sklearn/type_of_target.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mlens/externals/sklearn/type_of_target.py b/mlens/externals/sklearn/type_of_target.py index ab65a4f5..c1b56883 100644 --- a/mlens/externals/sklearn/type_of_target.py +++ b/mlens/externals/sklearn/type_of_target.py @@ -7,7 +7,11 @@ # License: BSD 3 clause from __future__ import division -from collections import Sequence +from sys import version_info +if (version_info.major == 3) and (version_info.minor == 10): + from collections.abc import Sequence +else: + from collections import Sequence from scipy.sparse import issparse