Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
据我所知,“compat”是 NLTK 的一些组件,TextBlob 是建立在上面的。奇怪的是,我过去曾导入过 TextBlob,所以这一定是最近的事情。我已经将 TextBlob 和 NLTK 都更新到了它们的最新版本,所以这不是问题所在。
诸如此类的类似问题基本上仍未解决,因为建议基本上是“不要导入所有的 NLTK”。
编辑:我的代码如下
from textblob import TextBlob
您确定 textblob 安装正确吗?你可能想试试
pip install -U textblob python -m textblob.download_corpora
之后尝试运行代码,它应该可以正常工作。