3

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

2
  • Which OS are you using? Commented Jun 24, 2014 at 6:56
  • Thanks. My answer is below, and there is also another good one that you can take a peek at :) Commented Jun 24, 2014 at 7:02

4 Answers 4

3

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

Sign up to request clarification or add additional context in comments.

Comments

2

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

Comments

1

With Windows 10 (64 bit), Python 3.6:

First install pip:

  1. copy the text in this link https://bootstrap.pypa.io/get-pip.py and save it to a file in your preferred folder. Call the file: "get-pip.py"
  2. click on start --> type "cmd" --> right click --> open as administrator
  3. cd C:\Users\yourpath\yourfolder\
  4. get-pip.py install
  5. if a message appears, saying to upgrade: python -m pip install --upgrade pip

Second:

  1. go to https://pypi.python.org/pypi/pyenchant/
  2. download 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\
  3. py -3.6 -m pip install pyenchant-2.0.0-py2.py3.cp27.cp32.cp33.cp34.cp35.cp36.pp27.pp33.pp35-none-win32.whl

Comments

0

Before you can install pyEnchant, you must install Enchant from here.

Then, and only then, run

pip install pyenchant

in your console to be able to use pyenchant in your python programs.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.