我在 python 3.2 virtualenv 中为 hunspell 库安装 pyhunspell 绑定时遇到问题。我从这里下载了 hunspell 。我发出./configure
并且make
它运行正常。但是我避免这样做,make install
因为我的目的是将它安装在我没有 root 权限的 web 服务器上的 virtualenv 上。
因此,我下载了 pyhunspell 绑定并将其解压缩到创建 hunspell 的目录。我通过添加正确的目的地修改include_dir
了路径并应用了允许使用 Python 3 构建 pyhunspell的补丁。然后我运行(之前激活了目标 virtualenv),但我得到了这个:setup.py
python setup.py install
$ 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的某个(可能是稳定的)版本,在我的计算机上编译的库是否也可以在服务器上运行?