How do I install hunspell on windows10?
Asked Answered
K

1

8

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.

Kobylak answered 18/10, 2019 at 22:30 Comment(3)
It looks like the Microsoft compiler is being used which would imply you're not doing what is described for building it on Windows in the readme.md file of the project.Elflock
Thank you @Martineau. So for windows10, is there a compiled package that I can use, similar to other python packages through pip install? Or do I need to compile using Mingw64 and MSYS2 as specified in readme.md?Kobylak
I looked in Christoph Gohlke's Python Extension Packages for Windows which I've used a number of time to get pre-compiled packages in the past, but it doesn't have this one. This means you might have to build it yourself using one of the outlined methods.Elflock
S
11

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. 

Saddlebag answered 31/5, 2020 at 14:27 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.