HspellPy 安装

HspellPy installation

我正在尝试安装 HspellPy 包(使用 google colab): pip 安装 HspellPy (https://pypi.org/project/HspellPy/) 我得到:

Collecting HspellPy
Using cached https://files.pythonhosted.org/packages/94/fb/d56f7809bae4a8376bc79974559a99c7deca3b3fe039acb4a4d67abd7f39/HspellPy-0.1.4.tar.gz
Building wheels for collected packages: HspellPy
Building wheel for HspellPy (setup.py) ... error
ERROR: Failed building wheel for HspellPy
Running setup.py clean for HspellPy
Failed to build HspellPy
Installing collected packages: HspellPy
Running setup.py install for HspellPy ... error
ERROR: Command errored out with exit status 1: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-_msu45vm/HspellPy/setup.py'"'"'; __file__='"'"'/tmp/pip-install-_msu45vm/HspellPy/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-record-lyfnm7ww/install-record.txt --single-version-externally-managed --compile Check the logs for full command output. 

我查找了一些针对“错误:HspellPy 的构建轮失败”的修复,但有一些帮助,而且由于该包没有被广泛使用,我找不到任何有用的东西

谢谢

对我来说,错误的主要部分是“致命错误:hspell.h:没有这样的文件或目录”,这意味着 Hspell 不是安装(HspellPy 只是用 C 编写的 Hspell 的 Python 包装器)。安装 Hspell;在 Debian/Ubuntu 上尝试

sudo apt install -y hspell

或从sources编译。

然后重试pip install HspellPy

您需要安装 hspell,因为它是 HspellPy 的依赖项。

我建议直接编译源代码并确保使用 enable-linginfo 进行编译,正如我在包描述中的 pypy 和 github 自述文件中所写的那样。 https://github.com/eranroz/HspellPy

如果直接从源码编译,在某些环境下上游工程(hspell)编译失败,需要更换: 要求“PrefixBits.pl”;

致: 需要“./PrefixBits.pl”; 在二值化-desc.pl 和 genprefixes.pl