On Apr 29, 2013, at 5:36, Helmut Jarausch <jarau...@igpm.rwth-aachen.de> wrote:

> On 04/27/2013 08:25:04 PM, Andi Vajda wrote:
>> Hi Helmut,
>> On Sat, 27 Apr 2013, Helmut Jarausch wrote:
>>> Hi,
>>> after a long time I'm in need to reinstall pylucene on my Gentoo system.
>>> Here, Lucene-3.5.0, oracle-jdk-bin-1.7.0.21 and Python-2.7.4 is installed.
>>> I fetched the pylucene_3_5 branch of 
>>> svn.apache.org/repos/asf/lucene/pylucene/
>>> Patching setuptools and installing jcc did work.
>>> But trying to build pylucene itself fails with:
>>> Traceback (most recent call last):
>>> File "/usr/lib64/python2.7/runpy.py", line 162, in _run_module_as_main
>>>  "__main__", fname, loader, pkg_name)
>>> File "/usr/lib64/python2.7/runpy.py", line 72, in _run_code
>>>  exec code in run_globals
>>> File 
>>> "/usr/lib64/python2.7/site-packages/JCC-2.16-py2.7-linux-x86_64.egg/jcc/__main__.py",
>>>  line 107, in <module>
>>>  cpp.jcc(sys.argv)
>>> File 
>>> "/usr/lib64/python2.7/site-packages/JCC-2.16-py2.7-linux-x86_64.egg/jcc/cpp.py",
>>>  line 655, in jcc
>>>  raise ValueError, (cls, 'python class name already in use, use --rename', 
>>> name, pythonNames[name])
>>> ValueError: (<Class: class org.apache.lucene.analysis.nl.DutchStemmer>, 
>>> 'python class name already in use, use --rename', u'DutchStemmer', <Class: 
>>> class org.tartarus.snowball.ext.DutchStemmer>)
>>> In addition there were some warnings:
>>> Warning: renaming static method 'toString' on class java.lang.Byte to 
>>> 'toString_' since it is shadowed by non-static method of same name.
>>> Warning: renaming static method 'getCurrentSegmentFileName' on class 
>>> org.apache.lucene.index.SegmentInfos to 'getCurrentSegmentFileName_' since 
>>> it is shadowed by non-static method of same name.
>>> Warning: renaming static method 'toString' on class java.lang.Boolean to 
>>> 'toString_' since it is shadowed by non-static method of same name.
>>> Warning: renaming static method 'foldToASCII' on class 
>>> org.apache.lucene.analysis.ASCIIFoldingFilter to 'foldToASCII_' since it is 
>>> shadowed by non-static method of same name.
>>> Warning: renaming static method 'copy' on class 
>>> org.apache.lucene.store.Directory to 'copy_' since it is shadowed by 
>>> non-static method of same name.
>>> Warning: renaming static method 'toString' on class java.lang.Long to 
>>> 'toString_' since it is shadowed by non-static method of same name.
>>> What am I missing?
>> The answer is in the error message:
>>  ValueError: (<Class: class org.apache.lucene.analysis.nl.DutchStemmer>,
>>  'python class name already in use, use --rename', u'DutchStemmer', <Class:
>>  class org.tartarus.snowball.ext.DutchStemmer>)
>> There are two classes named DutchStemmer and one must be wrapped with a 
>> renamed Python wrapper so as to not clash with the other. There several 
>> other cases of this in the PyLucene Makefile and you should use them as
>> examples:
>>  --rename org.apache.lucene.search.highlight.SpanScorer=HighlighterSpanScorer
>> Pick another name for the second DutchStemmer Python wrapper class (as in 
>> the example above and add this as a --rename line to the other ones in the 
>> Makefile.
>> This situation is fixed in the upcoming PyLucene 4.3 release where JCC
>> emits a complete package hierarchy and classes stay in their namespaces, no 
>> longer clashing.
>> As to the other warnings, they are just warnings. They matter if you want to 
>> call these methods.
>> Andi..
> 
> Thanks Andi,
> 
> I've added a few --rename lines and now it fails with
>  File "/usr/lib64/python2.7/runpy.py", line 162, in _run_module_as_main
>    "__main__", fname, loader, pkg_name)
>  File "/usr/lib64/python2.7/runpy.py", line 72, in _run_code
>    exec code in run_globals
>  File 
> "/usr/lib64/python2.7/site-packages/JCC-2.16-py2.7-linux-x86_64.egg/jcc/__main__.py",
>  line 107, in <module>
>    cpp.jcc(sys.argv)
>  File 
> "/usr/lib64/python2.7/site-packages/JCC-2.16-py2.7-linux-x86_64.egg/jcc/cpp.py",
>  line 455, in jcc
>    for arg in args[i].split(',')]))
> ValueError: dictionary update sequence element #0 has length 1; 2 is required
> make: *** [compile] Error 1

Please include the lines you added here so that I can I help you debug this. 
Did you end all lines with \ ?

> Can I use most recent version (SVN?) if I have dev-java/lucene-3.5.0 
> installed here?

Most recent version of what ?
JCC ? or both ?
Either way, yes, although trunk is based on the upcoming lucene 4.3 release and 
has a different API from lucene 3.x so you need to migrate your application 
code using PyLucene to the new API.

Andi..

> 
> Many thanks,
> Helmut.

Reply via email to