首页 文章

从Pydev中的PyLucene导入Lucene类的问题

提问于
浏览
0

我在Eclipse中安装了Pydev插件,我在python代码中调用了PyLucene . Lucene正处于PYTHONPATH之中

import lucene

没有错误 . 但是尝试使用从lucene类派生的任何内容都会产生“未解决的导入”错误 . 例如,

from org.apache.lucene.analysis.standard import StandardAnalyzer
from org.apache.lucene.index import DirectoryReader
from org.apache.lucene.queryparser.classic import QueryParser
from org.apache.lucene.search import IndexSearcher
from org.apache.lucene.store import SimpleFSDirectory
from org.apache.lucene.util import Version

上面的所有行都给出了这个错误 . 此外,这个代码在我的bash-shell命令行中运行得非常好 . 所以,我确保我的eclipse使用与我在shell中使用的PATH,LD_LIBRARY_PATH和PYTHONPATH相同的值 . 但是,错误仍然存在 .

这可能会出错?

1 回答

  • 0

    从版本4.0开始,pylucene从平面命名空间更改为嵌套命名空间,镜像java层次结构 .

    from org.apache.lucene.index import IndexReader
    

相关问题