Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I install hunspell on windows10?

I'm new to python and need help with getting hunspell installed on my windows 10. The tool is PyCharm.

First I tried to install CyHunspell: pip install CyHunspell and got the following error msg:

RuntimeError: 'pkg-config' is not recognized as an internal or external command,operable program or batch file.

Then I tried installing PyHunspell instead and got the following error msg:

ERROR: Could not find a version that satisfies the requirement PyHunspell (from versions: none)
ERROR: No matching distribution found for PyHunspell

Then I tried installing hunspell directly and got the following error msg:

hunspell.cpp
    hunspell.cpp(20): fatal error C1083: Cannot open include file: 'hunspell.hxx': No such file or directory
    error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\x86_amd64\\cl.exe' failed with exit status 2

In my test code:

import hunspell

Result:

spellchecker = hunspell.HunSpell() failed with the following error msg:
AttributeError: module 'hunspell' has no attribute 'HunSpell'

I would think I'm not the first one who uses hunspell on windows 10, but somehow I can't seem to find info needed to get this to work.

like image 206
LucyL Avatar asked Oct 18 '19 22:10

LucyL


1 Answers

The GNU Emacs documentation states here (underlined by me):

The EZWinPorts project provides many useful ports of recent versions of GNU and Unix software. This includes all the optional libraries used by Emacs (image libraries, libxml2, GnuTLS), RCS, Texinfo, a clone of man command, Grep, xz, bzip2, bsdtar, ID Utils, Findutils, Hunspell, Gawk, GNU Make, Groff, GDB.

You will indeed find Hunspell in the list of files of the EZWinPorts project on sourceforge.

Once unzipped, you shall find the executable hunspell.exe inside the bin folder. No installation required. The tool is to be used on the command-line. You probably should add it to your Windows Path.

Tested on my Windows 10 PC. 

like image 131
kotchwane Avatar answered Oct 15 '22 01:10

kotchwane