Skip to content

Get Error while import the module #12226

Closed

Description

@digital-mine

Description

I get this error after importing the module
/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

Can I ignore it?
How to solve it?

Steps/Code to Reproduce

import sklearn

Expected Results

NO ISSUE

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

PLATFORM=Linux-4.15.0-34-generic-x86_64-with-Ubuntu-18.04-bionic
PYTHON=Python 3.6.5 (default, Apr 1 2018, 05:46:30) [GCC 7.3.0]
NUMPY=NumPy 1.15.2
SCIPY= SciPy 1.1.0
SKLEARN=Scikit-Learn 0.20rc1

Activity

  1. zxhralf commented on Oct 1, 2018

    @zxhralf

    i also get this
    on macOs 10.12.6
    python 3.7
    numpy 1.15.2
    scipy 1.1.0
    scikit-learn 0.20.0

  2. ogrisel commented on Oct 1, 2018

    @ogrisel
    Member

    It can be ignored but ideally, it should be fixed in cloudpipe/cloudpickle#207 .

  3. digital-mine commented on Oct 3, 2018

    @digital-mine
    Author

    @ogrisel
    did you have the same issue, and you solved?

    I've read what you wrote in via the link you shared, but I could not understand the fix.
    Pardon my ignorance

  4. mohak2312 commented on Oct 5, 2018

    @mohak2312

    I face the same issue. Just try to install cloudpickle library. It works for me.

    pip install cloudpickle

  5. digital-mine commented on Oct 5, 2018

    @digital-mine
    Author

    with cloudpickle the issue is gone!

  6. yyb1995 commented on Oct 6, 2018

    @yyb1995

    I face the same issue. Just try to install cloudpickle library. It works for me.

    pip install cloudpickle

    This works!Thanks!

  7. drorata commented on Oct 8, 2018

    @drorata
    Contributor

    It seems like the issue was fixed on cloudpipe's side (see cloudpipe/cloudpickle#208). When will it become part of sklearn?

  8. ogrisel commented on Oct 8, 2018

    @ogrisel
    Member

    I released cloudpickle 0.6.0. It will be part of scikit-learn 0.20.1 in a couple of days or 0.20.2 at most.

  9. nklein9 commented on Oct 9, 2018

    @nklein9

    I've just installed cloudpickle and am still getting the error. This is after a restart as well. I'm quite new at this and don't know how to troubleshoot it efficiently.

    Windows 10pro 64bit
    Python version 3.7.0
    numpy version 1.15.1
    scipy version 1.1.0
    sklearn version 0.20.0
    cloudpickle version 0.6.0

  10. Apelsin commented on Oct 10, 2018

    @Apelsin

    @nklein9 same here

    >pip freeze
    cloudpickle==0.6.0
    numpy==1.15.2
    Pillow==5.3.0
    scikit-learn==0.20.0
    scipy==1.1.0
    
    >py -3 --version
    Python 3.6.5 :: Anaconda, Inc.
    

    Windows 10 x64

    Any ideas?

  11. yyb1995 commented on Oct 10, 2018

    @yyb1995

    @nklein9 same here

    >pip freeze
    cloudpickle==0.6.0
    numpy==1.15.2
    Pillow==5.3.0
    scikit-learn==0.20.0
    scipy==1.1.0
    
    >py -3 --version
    Python 3.6.5 :: Anaconda, Inc.
    

    Windows 10 x64

    Any ideas?

    The only difference is my cloudpickle version is 0.5.6. Maybe you can try this version. Not sure whether it will help.

  12. ivan-marroquin commented on Oct 11, 2018

    @ivan-marroquin

    Hi all,

    I had the same installation version as the one listed by @nklein9 in the previous post on an Ubuntu 18.04 machine. So, I removed cloudpickle 0.6.0 and installed version 0.5.6 - following suggestion from @yyb1995. Changing the version fixed the problem!

    Thanks,
    Ivan

  13. amueller commented on Oct 11, 2018

    @amueller
    Member

    btw this is a warning so really there is no issue to fix...

  14. nklein9 commented on Oct 12, 2018

    @nklein9

    @ivan-marroquin Thank you! I'll be working on it later today and will come back with results.

    @amueller my ide (komodo) stops completely. The error message says it's a warning but the ide treats it as an error and flags it as such. I tried running the code is vscode as well and got a similar result.

  15. amueller commented on Oct 12, 2018

    @amueller
    Member

    @nklein9 Either you have an option set to treat all warnings as errors (which would be kinda weird), or the issue is unrelated. If the same happens in multiple IDEs, that probably means there's a crash unrelated to the warning.

  16. Apelsin commented on Oct 12, 2018

    @Apelsin

    @amueller you are right, especially because the warning is printed to stderr, not stdout.
    Using cloudpickle 0.5.6 eliminated the warning.

  17. nklein9 commented on Oct 12, 2018

    @nklein9

    The downgrade to cloudpickle 0.5.6 worked. Thanks everyone.

  18. dreamlovesft commented on Oct 29, 2018

    @dreamlovesft

    I face the same issue. Just try to install cloudpickle library. It works for me.

    pip install cloudpickle

    Thanks,it also works for me.

  19. winterwindwang commented on Nov 19, 2018

    @winterwindwang

    @nklein9 same here

    >pip freeze
    cloudpickle==0.6.0
    numpy==1.15.2
    Pillow==5.3.0
    scikit-learn==0.20.0
    scipy==1.1.0
    
    >py -3 --version
    Python 3.6.5 :: Anaconda, Inc.
    

    Windows 10 x64
    Any ideas?

    The only difference is my cloudpickle version is 0.5.6. Maybe you can try this version. Not sure whether it will help.

    it works in my situation

  20. drorata commented on Nov 23, 2018

    @drorata
    Contributor

    Seems like updating sklearn to 0.20.1 solves the issue!

  21. KHALED-gtf commented on Dec 31, 2018

    @KHALED-gtf

    Solved By updating
    Thanks everybody

  22. sanjita-suresh commented on Jun 28, 2019

    @sanjita-suresh

    with

    scikit-learn==0.20.2
    

    no more warning is generated

  23. PortalMeJohn commented on Jan 30, 2020

    @PortalMeJohn

    pip install joblib

  24. tomasborrella commented on May 2, 2020

    @tomasborrella

    with

    scikit-learn==0.20.2
    

    no more warning is generated

    This worked for me:
    pip install scikit-learn=0.20.2

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