Skip to content

Cloudpickle.py, the imp module is deprecated in favor of importlib #12434

@1riggs

Description

@1riggs

Description

A deprecation warning is thrown when using sklearn. Recently cloudpickle was updated to do away with this warning, the sklearn version needs to be updated accordingly.

Steps/Code to Reproduce

I imagine this occurs anywhere cloudpickle is imported. I am getting it from:
from sklearn.ensemble import RandomForestRegressor
and using said Regressor

Expected Results

No deprecation warning should be thrown

Actual Results

/usr/local/lib/python3.6/dist-packages/sklearn/externals/joblib/externals/cloudpickle/cloudpickle.py:47: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
import imp

Versions

System

python: 3.6.6 (default, Sep 12 2018, 18:26:19)  [GCC 8.0.1 20180414 (experimental) [trunk revision 259383]]
executable: /usr/bin/python3.6
machine: Linux-4.15.0-36-generic-x86_64-with-Ubuntu-18.04-bionic

BLAS

macros: NO_ATLAS_INFO=1, HAVE_CBLAS=None
lib_dirs: /usr/lib/x86_64-linux-gnu
cblas_libs: cblas

Python deps

pip: 18.1
setuptools: 40.0.0
sklearn: 0.20.0
numpy: 1.15.3
scipy: 1.1.0
Cython: None
pandas: 0.23.4

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions