简体   繁体   English

pip install hunspell:无法打开包含文件:'hunspell.h':没有这样的文件或目录

[英]pip install hunspell: Cannot open include file: 'hunspell.h': No such file or directory

I'm trying to pip install hunspell on my windows 10 x64 machine, but I get the following error:我正在尝试在我的 Windows 10 x64 机器上pip install hunspell ,但出现以下错误:

C:\Users\a>pip install hunspell
Collecting hunspell
  Using cached hunspell-0.3.3.tar.gz
Installing collected packages: hunspell
  Running setup.py install for hunspell ... error
    Complete output from command c:\users\a\appdata\local\programs\python\python35-32\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\a\\AppData\\Local\\Temp\\pip-build-lmrkbjce\\hunspell\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record C:\Users\a\AppData\Local\Temp\pip-6k6fow3d-record\install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_ext
    building 'hunspell' extension
    creating build
    creating build\temp.win32-3.5
    creating build\temp.win32-3.5\Release
    C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -D_LINUX -I/usr/include/hunspell -Ic:\users\a\appdata\local\programs\python\python35-32\include -Ic:\users\a\appdata\local\programs\python\python35-32\include "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um" "-IC:\Program Files (x86)\Windows Kits\8.1\include\\shared" "-IC:\Program Files (x86)\Windows Kits\8.1\include\\um" "-IC:\Program Files (x86)\Windows Kits\8.1\include\\winrt" /Tchunspell.c /Fobuild\temp.win32-3.5\Release\hunspell.obj -Wall
    hunspell.c
    C:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt\corecrt_io.h(49): warning C4820: '_finddata32i64_t': '4' bytes padding added after data member 'name'
    C:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt\corecrt_io.h(54): warning C4820: '_finddata64i32_t': '4' bytes padding added after data member 'attrib'
    C:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt\corecrt_io.h(64): warning C4820: '__finddata64_t': '4' bytes padding added after data member 'attrib'
    C:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt\corecrt_io.h(69): warning C4820: '__finddata64_t': '4' bytes padding added after data member 'name'
    C:\Program Files (x86)\Windows Kits\8.1\include\\shared\basetsd.h(418): warning C4668: '_WIN32_WINNT' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif'
    C:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt\time.h(35): warning C4820: '_timespec64': '4' bytes padding added after data member 'tv_nsec'
    C:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt\time.h(42): warning C4820: 'timespec': '4' bytes padding added after data member 'tv_nsec'
    c:\users\a\appdata\local\programs\python\python35-32\include\pytime.h(112): warning C4115: 'timeval': named type definition in parentheses
    c:\users\a\appdata\local\programs\python\python35-32\include\pytime.h(160): warning C4820: '<unnamed-tag>': '4' bytes padding added after data member 'adjustable'
    c:\users\a\appdata\local\programs\python\python35-32\include\bytesobject.h(41): warning C4820: '<unnamed-tag>': '3' bytes padding added after data member 'ob_sval'
    c:\users\a\appdata\local\programs\python\python35-32\include\unicodeobject.h(917): warning C4820: '<unnamed-tag>': '2' bytes padding added after data member 'readonly'
    c:\users\a\appdata\local\programs\python\python35-32\include\longintrepr.h(92): warning C4820: '_longobject': '2' bytes padding added after data member 'ob_digit'
    c:\users\a\appdata\local\programs\python\python35-32\include\pystate.h(85): warning C4820: '_ts': '2' bytes padding added after data member 'recursion_critical'
    c:\users\a\appdata\local\programs\python\python35-32\include\genobject.h(32): warning C4820: '<unnamed-tag>': '3' bytes padding added after data member 'gi_running'
    c:\users\a\appdata\local\programs\python\python35-32\include\genobject.h(50): warning C4820: '<unnamed-tag>': '3' bytes padding added after data member 'cr_running'
    c:\users\a\appdata\local\programs\python\python35-32\include\pyerrors.h(18): warning C4820: '<unnamed-tag>': '3' bytes padding added after data member 'suppress_context'
    c:\users\a\appdata\local\programs\python\python35-32\include\pyerrors.h(22): warning C4820: '<unnamed-tag>': '3' bytes padding added after data member 'suppress_context'
    c:\users\a\appdata\local\programs\python\python35-32\include\pyerrors.h(32): warning C4820: '<unnamed-tag>': '3' bytes padding added after data member 'suppress_context'
    c:\users\a\appdata\local\programs\python\python35-32\include\pyerrors.h(39): warning C4820: '<unnamed-tag>': '3' bytes padding added after data member 'suppress_context'
    c:\users\a\appdata\local\programs\python\python35-32\include\pyerrors.h(48): warning C4820: '<unnamed-tag>': '3' bytes padding added after data member 'suppress_context'
    c:\users\a\appdata\local\programs\python\python35-32\include\pyerrors.h(53): warning C4820: '<unnamed-tag>': '3' bytes padding added after data member 'suppress_context'
    c:\users\a\appdata\local\programs\python\python35-32\include\pyerrors.h(65): warning C4820: '<unnamed-tag>': '3' bytes padding added after data member 'suppress_context'
    c:\users\a\appdata\local\programs\python\python35-32\include\pylifecycle.h(62): warning C4255: '_Py_CheckPython3': no function prototype given: converting '()' to '(void)'
    c:\users\a\appdata\local\programs\python\python35-32\include\fileutils.h(23): warning C4820: '_Py_stat_struct': '4' bytes padding added after data member 'st_dev'
    c:\users\a\appdata\local\programs\python\python35-32\include\fileutils.h(25): warning C4820: '_Py_stat_struct': '2' bytes padding added after data member 'st_mode'
    c:\users\a\appdata\local\programs\python\python35-32\include\fileutils.h(29): warning C4820: '_Py_stat_struct': '4' bytes padding added after data member 'st_rdev'
    c:\users\a\appdata\local\programs\python\python35-32\include\fileutils.h(32): warning C4820: '_Py_stat_struct': '4' bytes padding added after data member 'st_atime_nsec'
    c:\users\a\appdata\local\programs\python\python35-32\include\fileutils.h(34): warning C4820: '_Py_stat_struct': '4' bytes padding added after data member 'st_mtime_nsec'
    hunspell.c(21): fatal error C1083: Cannot open include file: 'hunspell.h': No such file or directory
    error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\cl.exe' failed with exit status 2

    ----------------------------------------
Command "c:\users\a\appdata\local\programs\python\python35-32\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\a\\AppData\\Local\\Temp\\pip-build-lmrkbjce\\hunspell\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record C:\Users\a\AppData\Local\Temp\pip-6k6fow3d-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\a\AppData\Local\Temp\pip-build-lmrkbjce\hunspell

C:\Users\a>

It seems that the installer is trying to reach a file named "hunspell.h" which can not be found.似乎安装程序正在尝试访问一个名为“hunspell.h”的文件,但该文件无法找到。

I tried to put the file I found at dxr.mozilla.org in "C:\\Users\\a\\AppData\\Local\\Programs\\Python\\Python35-32\\include".我试图将我在dxr.mozilla.org找到的文件放在“C:\\Users\\a\\AppData\\Local\\Programs\\Python\\Python35-32\\include”中。 Then I got a similar error about hunvisapi.h .然后我得到了一个关于hunvisapi.h的类似错误。 Created that, too.也创造了那个。 Now I'm getting LINK : fatal error LNK1181: cannot open input file 'hunspell.lib' .现在我收到LINK : fatal error LNK1181: cannot open input file 'hunspell.lib' I don't know where I can find this one yet;我不知道在哪里可以找到这个; but there must be an easier way to do all this.但必须有一种更简单的方法来做到这一切。

In short, how can I install hunspell without getting the errors above?简而言之,如何在不出现上述错误的情况下安装 hunspell?

Your problem is that pyhunspell is a binding to the C (coded using C Python API) hunspell library, thus it needs to compile.您的问题是 pyhunspell 绑定到 C(使用 C Python API 编码)hunspell 库,因此它需要编译。 To compile it needs to have hunspell installed and access to hunspell header files of the core hunspell program.要编译它,需要安装 hunspell 并访问核心 hunspell 程序的 hunspell 头文件。

The part with the header files you managed to tweak it but you need hunspell installed on your computer.您设法调整了带有头文件的部分,但您需要在计算机上安装 hunspell。 For that see here or here .为此,请参阅此处此处

Once it's done you can retry pip install or you can try precompiled package there is only one available but it might work (see http://pyhunspell.latinier.fr/ )完成后,您可以重试 pip install 或者您可以尝试预编译包,只有一个可用,但它可能有效(请参阅http://pyhunspell.latinier.fr/

Hope it helps.希望能帮助到你。

See this answer :看到这个答案

On Ubuntu:在 Ubuntu 上:

# installing gcc if not already installed
sudo apt install build-essentials

# installing CyHunspell, which is currently maintained (see link to answer)
pip install cyhunspell
# now you can
import hunspell
# and do your stuff

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 pip install pcapy 无法打开包含文件“pcap.h” - pip install pcapy cannot open include file 'pcap.h' Python pip install kivy致命错误C1083:无法打开包含文件:&#39;GL / glew.h&#39;:没有这样的文件或目录 - Python pip install kivy fatal error C1083: Cannot open include file: 'GL/glew.h': No such file or directory 执行`pip install mod_wsgi`时`无法打开包含文件:&#39;apr_perms_set.h&#39;` - `Cannot open include file: 'apr_perms_set.h'` when doing `pip install mod_wsgi` 无法安装 mysqlcient:无法打开包含文件:&#39;mysql.h&#39; - Cannot install mysqlcient: Cannot open include file: 'mysql.h' 无法打开包含文件:&#39;sys / mman.h&#39;:没有这样的文件或目录 - Cannot open include file: 'sys/mman.h':No such file or directory 无法打开包含文件:'mysql.h':没有这样的文件或目录 - Cannot open include file: 'mysql.h': No such file or directory 无法打开包含文件:“io.h”:没有这样的文件或目录 - Cannot open include file: 'io.h': No such file or directory pip 安装 mysqlclient 返回“fatal error C1083: Cannot open file: 'mysql.h': No such file or directory - pip install mysqlclient returns "fatal error C1083: Cannot open file: 'mysql.h': No such file or directory 无法安装mysql客户端1.3.12出现致命错误C1083:无法打开包含文件:mysql.h:无此类文件或目录 - Unable to install mysql client 1.3.12 getting fatal error C1083: Cannot open include file: 'mysql.h': No such file or directory 无法安装 matplotlib:致命错误 C1083:无法打开包含文件:'ft2build.h':没有这样的文件或目录 - Can't install matplotlib : fatal error C1083: Cannot open include file: 'ft2build.h': No such file or directory
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM