ImportError: cannot import name 'joblib' from 'sklearn.externals' (e:\mlp\anaconda3\lib\site-packages\sklearn\externals\__init__.py)
时间: 2023-07-08 18:47:55 浏览: 162
The error message suggests that you are trying to import the `joblib` module from the `sklearn.externals` package, but it is not found in that package.
In newer versions of scikit-learn (v0.21 and above), `joblib` has been moved to a standalone package and is no longer included in `sklearn.externals`. To fix this error, you should import `joblib` from its new location:
```python
from joblib import dump, load
```
You can then use the `dump` and `load` functions to save and load your machine learning models.
If you are using an older version of scikit-learn and cannot upgrade, you can try importing `joblib` from its old location:
```python
from sklearn.externals import joblib
```
However, this is not recommended as the `sklearn.externals` module has been removed in scikit-learn v0.23 and above, and `joblib` should always be imported from its standalone package.
阅读全文
相关推荐

















