question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
rthcommented, Oct 22, 2018

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.

0reactions
qinhanmin2014commented, Jul 5, 2019

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

imp module is deprecated in favour of importlib - Stack Overflow
Open the file with editing privileges named cloudpickle.py which is present at this location \sklearn\externals\joblib\externals\cloudpickle\ ...
Read more >
the imp module is deprecated in favour of importlib and slated ...
Open the file with editing privileges named cloudpickle.py which is present at this location \sklearn\externals\joblib\externals\cloudpickle\cloudpickle.py ...
Read more >
imp — Access the import internals — Python 3.11.1 ...
Deprecated since version 3.4, will be removed in version 3.12: The imp module is deprecated in favor of importlib . This module provides...
Read more >
stderr - CodaLab Worksheets
... DeprecationWarning: the imp module is deprecated in favour of importlib; ... imp /usr/local/lib/python3.6/site-packages/sklearn/metrics/ranking.py:651: ...
Read more >
the imp module is deprecated in favour of importlib - CSDN博客
1; 2. 1; 2. 原因. imp 从Python 3.4 之后弃用了,建议使用importlib 代替. 解决. 打开 E:\PyCharm 2018.2.5\helpers\pycharm\docrunner.py 文件,做 ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found