Reputation: 53
Hie can anyone help me out with detailed process of downloading & importing an external library called PyEnchant, to check a spelling of word is valid english word or not
Upvotes: 3
Views: 32750
Reputation: 325
With Windows 10 (64 bit), Python 3.6:
First install pip:
cd C:\Users\yourpath\yourfolder\
get-pip.py install
python -m pip install --upgrade pip
Second:
pyenchant-2.0.0-py2.py3.cp27.cp32.cp33.cp34.cp35.cp36.pp27.pp33.pp35-none-win32.whl
3) from the command line opened as administrator: cd C:\Users\yourpath\yourfolder\
py -3.6 -m pip install pyenchant-2.0.0-py2.py3.cp27.cp32.cp33.cp34.cp35.cp36.pp27.pp33.pp35-none-win32.whl
Upvotes: 1
Reputation: 12108
The official PyEnchant page asks these prerequisites before you install:
Prerequisites
To get PyEnchant up and running, you will need the following software installed:
Python 2.6 or later The enchant library, version 1.5.0 or later. For Windows users, the binary installers below include a pre-built copy of enchant. For Mac OSX users, the binary installers below include a pre-built copy of enchant.
For your convenience there's an exe which should be able to do the above - Download it.
If you want to install enchant first, and then pyenchant, then download enchant from here.
Pyenchant is on PyPi, so you should be able to
pip install pyenchant
If you don't have pip, then download get-pip.py and run python get-pip.py
(this might require you to have admin privileges)
and then in your python prompt,
>>> import enchant
>>> help(enchant)
From the documentation:
>>> import enchant
>>> d = enchant.Dict("en_US")
>>> d.check("Hello")
True
>>> d.check("Helo")
False
>>> d.suggest("Helo")
['He lo', 'He-lo', 'Hello', 'Helot', 'Help', 'Halo', 'Hell', 'Held', 'Helm', 'Hero', "He'll"]
Upvotes: 2
Reputation: 654
You have to install it with
pip install pyenchant
Simple usage Example from the docs:
import enchant
d = enchant.Dict("en_US")
d.check("Hello") # Returns True
d.check("Helo") # Returns False
For installing pip see: https://pip.pypa.io/en/latest/installing.html#install-pip
Upvotes: 3