Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot import Sklearn from sklearn.externals.joblib

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)

like image 687
Ayush Bajpayee Avatar asked May 13 '19 13:05

Ayush Bajpayee


People also ask

What is Joblib in Sklearn?

Joblib is a set of tools to provide lightweight pipelining in Python. In particular: transparent disk-caching of functions and lazy re-evaluation (memoize pattern)


1 Answers

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

like image 165
Konstantinos Kotsis Avatar answered Sep 24 '22 23:09

Konstantinos Kotsis