如何为 Anaconda 安装停用词包

新手上路,请多包涵

我如何为 Anaconda 安装 stop-words ,我将其用于带有 Anaconda-Navigator 的 jupyter notebook。

我可以安装 pip3 install... ,但我需要安装 conda install ... 以便我可以使用该包。

归根结底,我希望能够在 jupyter 中完成 from stop_words import get_stop_words

我试过了:

conda install stop-words

解决环境:失败

PackagesNotFoundError:当前渠道不提供以下软件包:

  • 停用词

当前频道:

这里还有“Anaconda”说明, https://anaconda.org/pypi/stop-words

 To install this package with pip, first run:

anaconda login
and then:
pip install -i https://pypi.anaconda.org/pypi/simple stop-words

Or:

TOKEN=$(anaconda auth --create --name download-token)
and then:
pip install -i https://pypi.anaconda.org/t/$TOKEN/pypi/simple stop-words

但这使用 pip 安装,而不是使用 conda。所以在这样做之后我仍然无法访问 jupyter。

原文由 tim_xyz 发布,翻译遵循 CC BY-SA 4.0 许可协议

阅读 970
1 个回答

我的解决方案是使用不同的包。

 import nltk
from nltk.corpus import stopwords
nltk.download('stopwords')
stopwords = stopwords.words('english')

而不是。

 from stop_words import get_stop_words

原文由 tim_xyz 发布,翻译遵循 CC BY-SA 3.0 许可协议

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进