gpt4 book ai didi

python - 安装 hunspell 包

转载 作者:行者123 更新时间:2023-12-02 23:45:56 24 4
gpt4 key购买 nike

我期待使用 pip 安装 hunspell 包,但它抛出以下错误:

Collecting hunspell
Using cached hunspell-0.4.1.tar.gz
Building wheels for collected packages: hunspell
Running setup.py bdist_wheel for hunspell ... error
Complete output from command /root/anaconda3/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-oyfpp3iy/hunspell/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/tmphqvqt4lxpip-wheel- --python-tag cp34:
/root/anaconda3/lib/python3.4/distutils/extension.py:132: UserWarning: Unknown Extension options: 'compile_args', 'macros'
warnings.warn(msg)
running bdist_wheel
running build
running build_ext
building 'hunspell' extension
creating build
creating build/temp.linux-x86_64-3.4
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/include/hunspell -I/root/anaconda3/include/python3.4m -c hunspell.c -o build/temp.linux-x86_64-3.4/hunspell.o
hunspell.c:21:22: erreur fatale: hunspell.h : Aucun fichier ou dossier de ce type
#include <hunspell.h>
^
compilation terminée.
error: command 'gcc' failed with exit status 1

----------------------------------------
Failed building wheel for hunspell
Running setup.py clean for hunspell
Failed to build hunspell
Installing collected packages: hunspell
Running setup.py install for hunspell ... error
Complete output from command /root/anaconda3/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-oyfpp3iy/hunspell/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-euhsmasb-record/install-record.txt --single-version-externally-managed --compile:
/root/anaconda3/lib/python3.4/distutils/extension.py:132: UserWarning: Unknown Extension options: 'compile_args', 'macros'
warnings.warn(msg)
running install
running build
running build_ext
building 'hunspell' extension
creating build
creating build/temp.linux-x86_64-3.4
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/include/hunspell -I/root/anaconda3/include/python3.4m -c hunspell.c -o build/temp.linux-x86_64-3.4/hunspell.o
hunspell.c:21:22: erreur fatale: hunspell.h : Aucun fichier ou dossier de ce type
#include <hunspell.h>
^
compilation terminée.
error: command 'gcc' failed with exit status 1

----------------------------------------
Command "/root/anaconda3/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-oyfpp3iy/hunspell/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-euhsmasb-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-oyfpp3iy/hunspell/
[root@localhost Bureau]# alias python-devel=python34-devel
[root@localhost Bureau]# pip install hunspell
Collecting hunspell
Using cached hunspell-0.4.1.tar.gz
Building wheels for collected packages: hunspell
Running setup.py bdist_wheel for hunspell ... error
Complete output from command /root/anaconda3/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-xpljhkom/hunspell/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/tmptwg_9c8vpip-wheel- --python-tag cp34:
/root/anaconda3/lib/python3.4/distutils/extension.py:132: UserWarning: Unknown Extension options: 'compile_args', 'macros'
warnings.warn(msg)
running bdist_wheel
running build
running build_ext
building 'hunspell' extension
creating build
creating build/temp.linux-x86_64-3.4
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/include/hunspell -I/root/anaconda3/include/python3.4m -c hunspell.c -o build/temp.linux-x86_64-3.4/hunspell.o
hunspell.c:21:22: erreur fatale: hunspell.h : Aucun fichier ou dossier de ce type
#include <hunspell.h>
^
compilation terminée.
error: command 'gcc' failed with exit status 1

----------------------------------------
Failed building wheel for hunspell
Running setup.py clean for hunspell
Failed to build hunspell
Installing collected packages: hunspell
Running setup.py install for hunspell ... error
Complete output from command /root/anaconda3/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-xpljhkom/hunspell/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-zrlp2go9-record/install-record.txt --single-version-externally-managed --compile:
/root/anaconda3/lib/python3.4/distutils/extension.py:132: UserWarning: Unknown Extension options: 'compile_args', 'macros'
warnings.warn(msg)
running install
running build
running build_ext
building 'hunspell' extension
creating build
creating build/temp.linux-x86_64-3.4
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/include/hunspell -I/root/anaconda3/include/python3.4m -c hunspell.c -o build/temp.linux-x86_64-3.4/hunspell.o
hunspell.c:21:22: erreur fatale: hunspell.h : Aucun fichier ou dossier de ce type
#include <hunspell.h>
^
compilation terminée.
error: command 'gcc' failed with exit status 1

----------------------------------------
Command "/root/anaconda3/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-xpljhkom/hunspell/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-zrlp2go9-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-xpljhkom/hunspell/

而且我听说安装 python3-dev 可以解决这个问题。我尝试过但没有成功。我在 CentOS 7 下使用 python 3.4。我可以寻求帮助吗?提前致谢。

最佳答案

我刚刚在 Centos7 64 位上使用 python3.4 和 pip3.4 完成了这个过程。 (注意,您需要 python3.4 和 pip3.4)

我最终通过 pip3.4 让它工作,但在这工作之前,我必须采取一些额外的步骤。我采取的步骤是:

安装python3.4开发头文件:

sudo yum install python34u-devel.x86_64

安装 hunspell 和 hunspell-devel(hunspell.h 和 hunspell lib 需要):

sudo yum install hunspell hunspell-devel

在/usr/lib64/中,为 hunspell 库添加额外的符号链接(symbolic link):

sudo ln -s libhunspell-1.3.so libhunspell.so

最后,运行命令:

sudo pip3.4 install hunspell

...这给了我以下输出:

... (compiler output deleted) ...
Successfully built hunspell
Installing collected packages: hunspell
Successfully installed hunspell-0.4.1

关于python - 安装 hunspell 包,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43756466/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com