Skip to content

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

Closed

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

Activity

  1. changed the title [-]Cloudpickle.py, The imp module is deprecated in favor of importlib[/-] [+]Cloudpickle.py, the imp module is deprecated in favor of importlib[/+] on Oct 22, 2018
  2. 1riggs commented on Oct 22, 2018

    @1riggs
    Author

    See joblib pull:
    joblib/joblib#788

  3. rth commented on Oct 22, 2018

    @rth
    Member

    Thanks for the information! That's a limitation of vendoring code unfortunately.

    We will sync with the latest joblib before releasing 0.20.1 which should fix it.

  4. 1riggs commented on Oct 22, 2018

    @1riggs
    Author

    Sounds great! Just wanted to make sure the team was aware, looking forward to not seeing the warning. Thanks for the otherwise awesome tool.

  5. qinhanmin2014 commented on Oct 23, 2018

    @qinhanmin2014
    Member

    Duplicate of #12226, please see the discussions there.

  6. loretoparisi commented on Jul 3, 2019

    @loretoparisi

    I'm using latest release of NLTK and I get the same issue!

    /usr/local/lib/python3.7/site-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
    
  7. qinhanmin2014 commented on Jul 5, 2019

    @qinhanmin2014
    Member

    @loretoparisi please update your scikit-learn and open another issue if the problem persists.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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