1

I have the Pydev plugin installed in my Eclipse, and I am calling PyLucene in my python code. Lucene is in the PYTHONPATH and hence

import lucene

gives no errors. But trying to use anything derived from lucene class gives 'unresolved import' error. For example,

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

all the lines above give this error. Further, this code works perfectly well from commandline in my bash-shell. So, I made sure that my eclipse uses the same values for PATH, LD_LIBRARY_PATH and PYTHONPATH as I am using in my shell. However, the error still persists.

What could be going wrong here?

nmramesh
  • 11
  • 3
  • I have quite the same problem, but it's with PyCharm - it cannot see the org.apache... path. In REPL all imports works, but it's impossible to use code inspection and other IDE features. Do you encounter the same problem? Is there any solutions? – privetartyomka Jan 13 '16 at 20:43

1 Answers1

0

Starting with version 4.0, pylucene changed from a flat to nested namespace, mirroring the java hierarchy.

from org.apache.lucene.index import IndexReader
A. Coady
  • 54,452
  • 8
  • 34
  • 40
  • Thanks, I was actually using the full name-space, so I fixed the information in the question. My issue still stands unresolved. – nmramesh Apr 15 '14 at 19:09