Cloudpickle.py, the imp module is deprecated in favor of importlib
See original GitHub issueDescription
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:
- Created 5 years ago
- Comments:6 (3 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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.
@loretoparisi please update your scikit-learn and open another issue if the problem persists.