pythonmachine-learningscikit-learnlinear-regressionscikits

scikit-learn 1.1.3. import cannot import name 'METRIC_MAPPING64' in python


I am trying to import linear model from scikit-learn into my python code in vscode and get an unexpected error message.

import sklearn
from sklearn import linear_model

the error:

cannot import name 'METRIC_MAPPING64' from 'sklearn.metrics._dist_metrics'

I am not trying to import these metrics, how to solve this?

The scikit-learn version used is 1.1.3.


Solution

  • I've tested and I solved problem by updating scikit-learn.

    pip install -U scikit-learn