pip install Scikit-learn==0.20.4
from sklearn.externals import joblib ImportError: cannot import name ‘joblib’
在機器學習中,有時需要保存或加載模型,就會引入from sklearn.externals import joblib
。但是大多數參考的文章時間太久,而sklearn.externals.joblib在0.21中已棄用,在0.23中被刪除。故因為scikit-learn版本問題,運行時會出現報錯:from sklearn.externals import joblib ImportError: cannot import name 'joblib'
解決方法:1.卸載安裝的 sklearn scikit-learn joblib
pip uninstall joblib scikit-leran sklearn
2.重新安裝scikit-learn,我安裝的版本是0.20.4
pip install Scikit-learn==0.20.4
這是Scikit-learn的可用文檔(Scikit-learn版本)
原文:https://blog.csdn.net/aclplr/article/details/107183926