【发布时间】:2013-12-22 12:05:43
【问题描述】:
我在 python 3.2 virtualenv 中为 hunspell 库安装 pyhunspell 绑定时遇到问题。我从here 下载了hunspell。我发出了./configure 和make,它运行良好。但是我避免使用make install,因为我的目的是将它安装在我没有 root 权限的 web 服务器上的 virtualenv 上。
因此,我下载了pyhunspell bindings 并将其解压缩到创建 hunspell 的目录。我通过添加正确的目的地修改了setup.py 中的include_dir 路径并应用了patch,它允许使用Python 3 构建pyhunspell。然后我运行python setup.py install(之前激活了目标virtualenv),但我得到了这个:
$ python setupy.py install
running install
running build
running build_ext
building 'hunspell' extension
gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -D_FORTIFY_SOURCE=2 -g -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -fPIC -D_LINUX -I./src/hunspell -I/usr/include/hunspell -I/usr/include/python3.2mu -c hunspell.c -o build/temp.linux-x86_64-3.2/hunspell.o -Wall
creating build/lib.linux-x86_64-3.2
gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-z,relro build/temp.linux-x86_64-3.2/hunspell.o -lhunspell-1.2 -o build/lib.linux-x86_64-3.2/hunspell.cpython-32mu.so
/usr/bin/ld: cannot find -lhunspell-1.2
collect2: error: ld returned 1 exit status
error: command 'gcc' failed with exit status 1
似乎链接器无法链接某些东西,因为它在系统路径中查找它,而我没有在系统中安装库。在 C 的奥秘中比我更聪明的人可以设计任何解决这个问题的方法吗?
我要补充一点,我还无法访问真实服务器,但我知道它的系统与我的本地系统(Debian 7.0 Wheezy)非常相似,所以我决定在实际使用之前尝试一下登录到服务器。假设它也是 Debian 的某个(可能是稳定的)版本,在我的计算机上编译的库是否也可以在服务器上运行?
【问题讨论】:
-
与论坛网站不同,我们不使用“谢谢”、“感谢任何帮助”或Stack Overflow 上的签名。见“Should 'Hi', 'thanks,' taglines, and salutations be removed from posts?.
标签: linux python-3.x virtualenv hunspell