当前位置: 首页 > 知识库问答 >
问题:

COLAB错误:命令错误退出状态1:pythonsetup.pyegg_info检查日志的完整命令输出

关玄裳
2023-03-14

谁能帮我修一下吗?我正在尝试在colab中安装pyenchant,以便在单词拼写错误时执行可能的建议。我想使用pyenchant。这就是我所尝试的;

!pip install pyenchant==1.6.8 

但它输出以下错误;

ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

我的想法是得到一些可能的建议,如果一个词是错的,我计划做以下几点

import enchant
test = enchant.Dict("en_US")
test.suggest("Posible")

有人能建议我如何做到这一点吗?我正在研究colab。请帮助我如何在colab中安装pyenchant,或者在单词错误时我可以获得任何其他可能的建议。

共有2个答案

闽经纬
2023-03-14

另一种基于NLTK而不使用enchant的可能性是NLTK的单词语料库

>>> from nltk.corpus import words
>>> "would" in words.words()
True
>>> "could" in words.words()
True
>>> "should" in words.words()
True
>>> "I" in words.words()
True
>>> "you" in words.words()
True

或者如果你还想使用enchanthttps://stackoverflow.com/a/57444274/11339475看看这个解决方案,它已经被解决了。

公良渝
2023-03-14

你需要先安装apt

!apt install enchant

然后是皮普

!pip install pyenchant
 类似资料: