在CentOS 5.5上安装Xapian for Python 2.6

时间:2010-12-21 10:34:04

标签: python django django-haystack xapian

我在CentOS 5.5上使用Django 1.2 for Python 2.6,我试图用Xapian作为搜索后端安装Django Haystack。我已按照http://docs.haystacksearch.org/dev/installing_search_engines.html#xapian上的安装说明以及http://xapian.org/download上的RedHat Enterprise Linux RPM软件包的说明进行操作。 Xapian已安装,但已附加到Python 2.4,由于其他原因需要存在于CentOS中。所以,如果我进入'python'shell并'import xapian'它可以正常工作,但是如果我进入'python26'shell并'import xapian',我会得到错误'没有名为Xapian的模块'。

然后我尝试在Python 2.4站点包中的python 2.6站点包中创建一个符号链接到Xapian,这在尝试在python 2.6 shell中导入xapian时出现以下错误:
RuntimeWarning:模块_xapian的Python C API版本不匹配:此Python具有API版本1013,模块_xapian具有版本1012。

我还尝试指定在配置xapian-core时使用的python库,如http://invisibleroads.com/tutorials/xapian-search-pylons.html#install-xapian-on-webfaction所示,因此我使用的命令是:
    ./configure PYTHON = / usr / bin / python2.6
然后安装我使用的xapian绑定:
    ./configure PYTHON = / usr / bin / python26 PYTHON_LIB = / usr / lib / python2.6 --with-python
这没有明显区别,所以我现在有点卡住了。有没有人有任何想法?

1 个答案:

答案 0 :(得分:2)

构建xapian-bindings包时,你会想要./configure --with-python PYTHON=/usr/bin/python2.6听起来像是在xapian-core上尝试这样做,这不是正确的地方。