Python 找不到记录器的处理程序;sklearn.datasets.twenty“U新闻组”;

Python 找不到记录器的处理程序;sklearn.datasets.twenty“U新闻组”;,python,Python,我运行了《Python数据科学概要》一书中第2章的示例。看来: No handlers could be found for logger "sklearn.datasets.twenty_newsgroups" 下面是示例代码: from sklearn.datasets import fetch_20newsgroups categories = ['sci.med', 'sci.space'] twenty_sci_news = fetch_20newsgroups(categories

我运行了《Python数据科学概要》一书中第2章的示例。看来:

No handlers could be found for logger "sklearn.datasets.twenty_newsgroups"
下面是示例代码:

from sklearn.datasets import fetch_20newsgroups
categories = ['sci.med', 'sci.space']
twenty_sci_news = fetch_20newsgroups(categories=categories)

这是因为您的系统上没有下载数据集

像这样运行示例代码

import logging
from sklearn.datasets import fetch_20newsgroups
logging.basicConfig() # to show logging message of what is happening behind the scene.

categories = ['sci.med', 'sci.space']
twenty_sci_news = fetch_20newsgroups(categories=categories)
它将显示幕后发生的事情。尝试进行相应的调试

希望有帮助