2

我花了 5 个小时来解决这个问题,但我不能。在使用http://lucene.apache.org/pylucene/install.htmt安装 PyLucene 期间,我遇到了如下错误。

sanghee-m:jcc sanghee$ python setup.py build
found JAVAFRAMEWORKS = /System/Library/Frameworks/JavaVM.framework
Traceback (most recent call last):
  File "setup.py", line 398, in <module>
    main('--debug' in sys.argv)
  File "setup.py", line 306, in main
    from setuptools import Library
ImportError: cannot import name Library
sanghee-m:jcc sanghee$ python setup.py build --debug
found JAVAFRAMEWORKS = /System/Library/Frameworks/JavaVM.framework
Traceback (most recent call last):
  File "setup.py", line 398, in <module>
    main('--debug' in sys.argv)
  File "setup.py", line 306, in main
    from setuptools import Library
ImportError: cannot import name Library
sanghee-m:jcc sanghee$ 

我也找不到图书馆。我该如何解决这个问题?当我收到这种错误时,你能告诉我应该在哪里检查吗?

另外,我安装了 setuptools 1.1.6 并使用了 pylucene-4.4.0-1。

sanghee-m:jcc sanghee$ python
Python 2.7.5 (v2.7.5:ab05e7dd2788, May 13 2013, 13:18:45) 
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import setuptools
4

2 回答 2

2

我正在尝试在windows下编译JCC,我发现setuptools的最新版本,1.1.6,给出了你报的导入错误。但是在 0.6c11 版本中可以找到库模块。

编辑:1.1.3 也可以。

于 2013-10-11T14:08:24.470 回答
0

这似乎是一个愚蠢的问题,但您是否安装了 setuptools? https://pypi.python.org/pypi/setuptools/0.6c11

于 2013-10-11T08:27:12.090 回答