我通过macports安装了xapian,为什么这个Python应用告诉我需要安装xapian?
我在我的系统上尝试运行一个Python应用程序。每次执行时,都会出现一个错误提示,最后说我需要安装Xapian。所以我使用macports安装了xapian-core和xapian-bindings。然后我再次尝试运行这个Python应用程序,但还是出现了同样的错误提示。请问我接下来该怎么办?是不是还需要安装什么额外的xapian-python东西?这些对我来说都是新鲜事。
我使用的是Mac OS 10.6.3,Python 2.6.5和Django 1.2.1。
这是我看到的错误提示的最后几行:
File "/Users/nick/dev/ymtest/../ymtest/lib/haystack/__init__.py", line 46, in <module>
backend = load_backend(settings.HAYSTACK_SEARCH_ENGINE)
File "/Users/nick/dev/ymtest/../ymtest/lib/haystack/__init__.py", line 21, in load_backend
return __import__('haystack.backends.%s_backend' % settings.HAYSTACK_SEARCH_ENGINE, {}, {}, [''])
File "/Users/nick/dev/ymtest/../ymtest/lib/haystack/backends/xapian_backend.py", line 18, in <module>
raise MissingDependency("The 'xapian' backend requires the installation of 'xapian'. Please refer to the documentation.")
haystack.exceptions.MissingDependency: The 'xapian' backend requires the installation of 'xapian'. Please refer to the documentation.
1 个回答
以下步骤在我遇到同样问题的 OS X 10.5 上有效:
首先,更新 macports:
输入命令:sudo port selfupdate
通过 macports 安装 python 2.6:
输入命令:sudo port install python26
安装 python_select 工具:
输入命令:sudo port install python_select
将 python 2.6 设置为系统默认版本:
输入命令:sudo python_select python26
安装 xapian-core:
输入命令:sudo port install xapian-core
安装 xapian-bindings,并指定使用 PYTHON 版本:
输入命令:sudo port install xapian-bindings +python26
将你所有的 python 库从 "/Library/Python/2.5/site-packages" 复制到 "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages", 这是你新的默认库文件夹!
重启终端。
完成!