You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pylucene-dev@lucene.apache.org by Helmut Jarausch <ja...@igpm.rwth-aachen.de> on 2009/04/22 11:22:27 UTC

pylucene (SVN) fails under Python-2.6.2

Hi,

has anybody tried to install PyLucene on a system running Python-2.6
(2.6.2 in my case)

Installing jcc works just fine, but when executing 'make' I get
/usr/bin/python -m jcc --shared --jar lucene-java-2.4.1/build/lucene-core-2.4.1.jar --jar lucene-java-2.4.1/build/contrib/snowball/lucene-snowball-2.4.1.jar --jar lucene-java-2.4.1/build/contrib/highlighter/lucene-highlighter-2.4.1.jar --jar lucene-java-2.4.1/build/contrib/analyzers/lucene-analyzers-2.4.1.jar --jar lucene-java-2.4.1/build/contrib/regex/lucene-regex-2.4.1.jar --jar lucene-java-2.4.1/build/contrib/queries/lucene-queries-2.4.1.jar --jar lucene-java-2.4.1/build/contrib/instantiated/lucene-instantiated-2.4.1.jar --jar build/jar/extensions.jar --package java.lang java.lang.System java.lang.Runtime --package java.util java.util.Arrays java.text.SimpleDateFormat --package java.io java.io.StringReader java.io.InputStreamReader java.io.FileInputStream --exclude org.apache.lucene.queryParser.Token --exclude org.apache.lucene.queryParser.TokenMgrError --exclude org.apache.lucene.queryParser.QueryParserTokenManager --exclude org.apache.lucene.queryParser.ParseException --
 python lucene --mapping org.apache.lucene.document.Document 'get:(Ljava/lang/String;)Ljava/lang/String;' --mapping java.util.Properties 'getProperty:(Ljava/lang/String;)Ljava/lang/String;' --sequence org.apache.lucene.search.Hits 'length:()I' 'doc:(I)Lorg/apache/lucene/document/Document;' --version 2.4.1 --module python/collections.py --files 1 --build 
/usr/bin/python: jcc is a package and cannot be directly executed
make: *** [compile] Error 1

Many thanks for any hints,
Helmut.

-- 
Helmut Jarausch

Lehrstuhl fuer Numerische Mathematik
RWTH - Aachen University
D 52056 Aachen, Germany

Re: pylucene (SVN) fails under Python-2.6.2

Posted by Andi Vajda <va...@apache.org>.
On Wed, 22 Apr 2009, Christian Heimes wrote:

> Helmut Jarausch schrieb:
>> Hi,
>>
>> has anybody tried to install PyLucene on a system running Python-2.6
>> (2.6.2 in my case)
  .. snip ..
>> /usr/bin/python: jcc is a package and cannot be directly executed
>> make: *** [compile] Error 1

> Hello Helmut!
>
> Your problem ca be fixed easily. You simple have to replace "-m jcc"
> with "-m jcc.__main__" in your Makefile. Python 2.6 refuses to execute a
> package but the new jcc.__main__ modules takes care of the issue.

In Python 2.6, it is not allowed to execute a package directly. It was 
determined that the Python 2.5 feature allowing this was actually a bug.

This was discussed and resolved in Python issue 4195 by making it possible 
to use -m <package> again if the package has a __main__ module. In Python 
2.7, -m jcc works again and is equivalent to -m jcc.__main__.

http://bugs.python.org/issue4195

Andi..

Re: pylucene (SVN) fails under Python-2.6.2

Posted by Christian Heimes <li...@cheimes.de>.
Helmut Jarausch schrieb:
> Hi,
> 
> has anybody tried to install PyLucene on a system running Python-2.6
> (2.6.2 in my case)
> 
> Installing jcc works just fine, but when executing 'make' I get
> /usr/bin/python -m jcc --shared --jar lucene-java-2.4.1/build/lucene-core-2.4.1.jar --jar lucene-java-2.4.1/build/contrib/snowball/lucene-snowball-2.4.1.jar --jar lucene-java-2.4.1/build/contrib/highlighter/lucene-highlighter-2.4.1.jar --jar lucene-java-2.4.1/build/contrib/analyzers/lucene-analyzers-2.4.1.jar --jar lucene-java-2.4.1/build/contrib/regex/lucene-regex-2.4.1.jar --jar lucene-java-2.4.1/build/contrib/queries/lucene-queries-2.4.1.jar --jar lucene-java-2.4.1/build/contrib/instantiated/lucene-instantiated-2.4.1.jar --jar build/jar/extensions.jar --package java.lang java.lang.System java.lang.Runtime --package java.util java.util.Arrays java.text.SimpleDateFormat --package java.io java.io.StringReader java.io.InputStreamReader java.io.FileInputStream --exclude org.apache.lucene.queryParser.Token --exclude org.apache.lucene.queryParser.TokenMgrError --exclude org.apache.lucene.queryParser.QueryParserTokenManager --exclude org.apache.lucene.queryParser.ParseException 
--
>  python lucene --mapping org.apache.lucene.document.Document 'get:(Ljava/lang/String;)Ljava/lang/String;' --mapping java.util.Properties 'getProperty:(Ljava/lang/String;)Ljava/lang/String;' --sequence org.apache.lucene.search.Hits 'length:()I' 'doc:(I)Lorg/apache/lucene/document/Document;' --version 2.4.1 --module python/collections.py --files 1 --build 
> /usr/bin/python: jcc is a package and cannot be directly executed
> make: *** [compile] Error 1

Hello Helmut!

Your problem ca be fixed easily. You simple have to replace "-m jcc"
with "-m jcc.__main__" in your Makefile. Python 2.6 refuses to execute a
package but the new jcc.__main__ modules takes care of the issue.

Christian