Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get Error while import the module #12226

Closed
digital-mine opened this issue Sep 30, 2018 · 24 comments
Closed

Get Error while import the module #12226

digital-mine opened this issue Sep 30, 2018 · 24 comments

Comments

@digital-mine
Copy link

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

@zxhralf
Copy link

zxhralf commented Oct 1, 2018

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

@ogrisel
Copy link
Member

ogrisel commented Oct 1, 2018

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

@digital-mine
Copy link
Author

digital-mine commented Oct 3, 2018

@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

@mohak2312
Copy link

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

pip install cloudpickle

@digital-mine
Copy link
Author

with cloudpickle the issue is gone!

@yyb1995
Copy link

yyb1995 commented Oct 6, 2018

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

pip install cloudpickle

This works!Thanks!

@drorata
Copy link
Contributor

drorata commented Oct 8, 2018

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

@ogrisel
Copy link
Member

ogrisel commented Oct 8, 2018

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.

@nklein9
Copy link

nklein9 commented Oct 9, 2018

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

@Apelsin
Copy link

Apelsin commented Oct 10, 2018

@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?

@yyb1995
Copy link

yyb1995 commented Oct 10, 2018

@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.

@ivan-marroquin
Copy link

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

@amueller
Copy link
Member

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

@nklein9
Copy link

nklein9 commented Oct 12, 2018

@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.

@amueller
Copy link
Member

amueller commented Oct 12, 2018

@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.

@Apelsin
Copy link

Apelsin commented Oct 12, 2018

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

@nklein9
Copy link

nklein9 commented Oct 12, 2018

The downgrade to cloudpickle 0.5.6 worked. Thanks everyone.

@dreamlovesft
Copy link

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

pip install cloudpickle

Thanks,it also works for me.

@winterwindwang
Copy link

@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

@drorata
Copy link
Contributor

drorata commented Nov 23, 2018

Seems like updating sklearn to 0.20.1 solves the issue!

@KHALED-gtf
Copy link

Solved By updating
Thanks everybody

@sanjita-suresh
Copy link

with

scikit-learn==0.20.2

no more warning is generated

@PortalMeJohn
Copy link

pip install joblib

@tomasborrella
Copy link

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
Labels
None yet
Projects
None yet
Development

No branches or pull requests