-1

I started working on sklearn recently, i executed a command:

from sklearn.datasets import fetch_openml

it gave an error as:

File "/usr/lib/python3/dist-packages/sklearn/externals/joblib.py", line 1 import imp DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses"

Now i have no clue what to do next.. every other library like matplotlib and pandas are working just fine othr than sklearn. any help would be much appreciated

Sergey Bushmanov
  • 23,310
  • 7
  • 53
  • 72
  • 1
    It's not actually a error, it's a *warning*... You can work safely with your code. If you still want to remove it, see my answer.... – Sergey Bushmanov Feb 15 '20 at 09:12

1 Answers1

2

One way would be just to update your sklearn:

import sklearn
print(sklearn.__version__)
0.22.1
from sklearn.datasets import fetch_openml

No error as you see.

Another way is to silence a warning:

import warnings
warnings.filterwarnings("ignore", category=DeprecationWarning)
Sergey Bushmanov
  • 23,310
  • 7
  • 53
  • 72