导入sklearncannot import name 'logger' from 'joblib' (unknown location)
时间: 2023-10-05 14:07:41 浏览: 242
这个错误可能是由于joblib版本冲突导致的。尝试升级joblib版本或降级sklearn版本。
你可以通过以下命令升级joblib:
```python
pip install --upgrade joblib
```
如果这个命令没有解决问题,你可以尝试降级sklearn版本:
```python
pip install scikit-learn==0.21.3
```
如果以上方法都没有解决问题,你可以尝试重新安装sklearn和joblib:
```python
pip uninstall scikit-learn joblib
pip install scikit-learn joblib
```
相关问题
cannot import name 'logger' from 'joblib' (unknown location)
This error occurs when the imported module 'joblib' doesn't have a function or class named 'logger'.
You can try the following steps to resolve the error:
1. Check if the module 'joblib' is correctly installed in your environment. You can install it using pip or conda, depending on your environment.
2. Check if you are importing the correct module. Sometimes, a typo in the module name can cause the error.
3. Check the joblib documentation to see if the 'logger' function or class is supported by the module. If not, you may need to find an alternative solution to your problem.
4. If you are still unable to resolve the issue, consider seeking help from the joblib community or posting a question on a relevant forum or Stack Overflow.
cannot import name 'logger' from 'joblib'
This error message usually appears when you try to import the logger module from the joblib package, but the logger module is not available in joblib. The logger module is actually part of the Python standard library and can be imported directly using the following code:
```
import logging
```
If you need to use the logger module in your joblib code, you can import it as follows:
```
from logging import getLogger
```
This will import the getLogger function from the logging module, which you can then use to create a logger object in your code.