I'm new to scikit-learn, and currently I just want to use its train_test_split function. Below is what I typed:
from sklearn.model_selection import train_test_split
And this is the error message:
Output exceeds the size limit. Open the full output data in a text editor
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
Cell In[18], line 1
----> 1 from sklearn.model_selection import train_test_split
File ~/.conda/envs/tf/lib/python3.10/site-packages/sklearn/model_selection/__init__.py:23
20 from ._split import train_test_split
21 from ._split import check_cv
---> 23 from ._validation import cross_val_score
24 from ._validation import cross_val_predict
25 from ._validation import cross_validate
File ~/.conda/envs/tf/lib/python3.10/site-packages/sklearn/model_selection/_validation.py:32
30 from ..utils.fixes import delayed
31 from ..utils.metaestimators import _safe_split
---> 32 from ..metrics import check_scoring
33 from ..metrics._scorer import _check_multimetric_scoring, _MultimetricScorer
34 from ..exceptions import FitFailedWarning
File ~/.conda/envs/tf/lib/python3.10/site-packages/sklearn/metrics/__init__.py:41
37 from ._classification import multilabel_confusion_matrix
39 from ._dist_metrics import DistanceMetric
---> 41 from . import cluster
42 from .cluster import adjusted_mutual_info_score
43 from .cluster import adjusted_rand_score
...
19 )
File sklearn/metrics/_pairwise_distances_reduction/_base.pyx:1, in init sklearn.metrics._pairwise_distances_reduction._base()
AttributeError: module 'sklearn.metrics._dist_metrics' has no attribute 'DistanceMetric32'
I've tried to search for similar errors, and most of them are version issues. My Python is 3.10.8 and scikit-learn is 1.2.0. I tried to upgrading (1.2.0 is already the latest) and downgrading, but the error remains. In addition, the other errors I found are lack of some other attributes rather than 'DistanceMetric32'. Could anyone provides some ideas?