Cannot import Sklearn from sklearn.externals.joblib

Ayush Bajpayee picture Ayush Bajpayee · May 13, 2019 · Viewed 11.2k times · Source

I am a beginner and I just started with machine learning. I am trying to import classes like imputer from sklearn but i am unable to do it.

from sklearn.preprocessing import Imputer,LabelEncoder,OneHotEncoder,StandardScaler

ImportError: cannot import name 'version' from 'sklearn.externals.joblib' (C:\ProgramData\Anaconda3\lib\site-packages\sklearn\externals\joblib__init__.py)

Answer

Konstantinos Kotsis picture Konstantinos Kotsis · Jul 24, 2020

I had the same problem. I have replaced

from sklearn.externals import joblib

with

import joblib

and it works fine in Python 3.7.2