Could anyone please help me to fix this? I am trying to install pyenchant in colab to perform a possible suggestion if a word is spelled wrongly. I would like to use pyenchant. This is what I tried;

!pip install pyenchant==1.6.8 

but it output the following error;

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

My idea is to get some possible suggestion if a word is wrong, I plan to do the following

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

Could anyone suggest how can I achieve this? I am working on colab. Please help me on how to install pyenchant in colab or any other possible way I can achieve possible suggestion if a word is wrong.

2

There are 2 best solutions below

0
On BEST ANSWER

You need to install with apt first

!apt install enchant

Then with pip

!pip install pyenchant
0
On

Another possibility based on NLTK without enchant is NLTK's words corpus

>>> 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

Or if you still want to use enchant https://stackoverflow.com/a/57444274/11339475 Have look at this solution, It has already been addressed.