从此处下载适用于 Mac 的预构建 JCC 和 pylucene 鸡蛋。
到目前为止,python 2.6 的最新版本是 JCC-2.8 和 lucene-3.1.0,所以下面我将使用 easy_install-2.6 和 python2.6。
安装它们:
$ sudo easy_install-2.6 JCC-*.egg
$ sudo easy_install-2.6 lucene-*.egg
测试:
$ python2.6
>>> import jcc
>>> import lucene
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Library/Python/2.6/site-packages/lucene-3.1.0-py2.6-macosx-10.6-universal.egg/lucene/__init__.py", line 7, in <module>
import _lucene
ImportError: dlopen(/Library/Python/2.6/site-packages/lucene-3.1.0-py2.6-macosx-10.6-universal.egg/lucene/_lucene.so, 2): Library not loaded: @rpath/libjcc.dylib
Referenced from: /Library/Python/2.6/site-packages/lucene-3.1.0-py2.6-macosx-10.6-universal.egg/lucene/_lucene.so
Reason: image not found
如果您收到上述错误,只需创建libjcc.dylib
in 的符号链接即可修复它/usr/local/lib/
。libjcc.dylib
应该在里面site-packages/JCC-*.egg/
。
>>> jcc.__file__
'/Library/Python/2.6/site-packages/JCC-2.8-py2.6-macosx-10.7-intel.egg/jcc/__init__.pyc'
>>> ^D
$ ln -s /Library/Python/2.6/site-packages/JCC-2.8-py2.6-macosx-10.7-intel.egg/libjcc.dylib /usr/local/lib/
$ python2.6
>>> import jcc, lucene
>>>