lucene-pylucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andi Vajda <va...@apache.org>
Subject Re: building PyLucene 3.0.2 on Win7/MinGW with Python 2.7
Date Mon, 29 Nov 2010 17:58:22 GMT

On Nov 29, 2010, at 9:45, Bill Janssen <janssen@parc.com> wrote:

> Andi Vajda <vajda@apache.org> wrote:
>
>> I just tried this myself
>
> By "this", do you mean 64-bit Windows 7, or Python 2.7?

Both. 64 bit Windows 7, with Python 2.7 and Java 1.6.0_22 both 32-bit.

>
>> and it seems that with Python 2.7 __name__ is
>> never equal to '__main__' in jcc's __init__.py. So, jcc.__main__ is
>> never imported implicitely from __init__.py and hence --find-jvm-dll
>> is ineffective.
>>
>> I moved the --find-jvm-dll trickery to __init__.py and that seems to
>> solve the problem. Of course, this is all masked if the PATH already
>> contains the JRE directories.
>>
>> Andi..
>
> Thanks.  Though I thought that the --find-jvm-dll switch only worked  
> if
> it was explicitly specified, which I wasn't doing.  So while that's  
> one
> Python 2.7 issue, I don't think that's the problem I was seeing,  
> right?

Yes, it only kicks in if used explicitely but didn't work. Putting the  
jre/bin and jre/bin/client dirs on PATH also works around the problem  
but masks the --find-jvm-dll problem.

> I'm going to go back to 32-bit XP, and get things working with Python
> 2.7 on that platform.  Once I have that, I'll go back to 64-bit  
> Windows 7.

I don't think that makes any difference. I think (but I could be  
wrong) that the issue is with Python 2.7 and the value of __name__ in  
__init__.py when invoking a package via -m.

Andi..

>
> Bill
>
>>>>>> I got a brand-new Windows 7 machine, and thought I'd try building
>>>>>> PyLucene with a newer version of Python, 2.7, the 32-bit version.
>>>>>>
>>>>>> I also had to move to setuptools-0.6c11, because 0.6c9 doesn't  
>>>>>> seem to
>>>>>> work with Python 2.7.  Using 32-bit Java 6.0_22.
>>>>>>
>>>>>> But I can't get JCC to run here:
>>>>>>
>>>>>> sh-3.1$ which jcc.dll
>>>>>> /c/Python27/Lib/site-packages/JCC-2.6-py2.7-win32.egg/jcc.dll
>>>>>> sh-3.1$ which jvm.dll
>>>>>> /c/Program Files (x86)/Java/jre6/bin/client/jvm.dll
>>>>>> sh-3.1$ python -m jcc.__main__ --help
>>>>>> c:\Python27\python.exe: DLL load failed: The specified module  
>>>>>> could not be found.
>>>>>> sh-3.1$
>>>>>>
>>>>>> sh-3.1$ python -c 'import os; print os.environ.get("PATH")'
>>>>>> c:\Windows\system32;c:\Windows;c:\Windows\System32\Wbem;c: 
>>>>>> \Windows\System32\WindowsPowerShell\v1.0\;C:\MinGW\msys 
>>>>>> \1.0\bin;C:\MinGW\bin;c:\Python27;c:\Program Files\apache- 
>>>>>> ant-1.8.1\bin;c:\Program Files (x86)\Java\jre6\bin\client;c: 
>>>>>> \Python27\Lib\site-packages\JCC-2.6-py2.7-win32.egg
>>>>>>
>>>>>> It seems to build and install OK, but when I run python in  
>>>>>> verbose mode,
>>>>>> I see
>>>>>>
>>>>>> import jcc # directory c:\Python27\lib\site-packages\jcc-2.6- 
>>>>>> py2.7-win32.egg\jcc
>>>>>> # c:\Python27\lib\site-packages\jcc-2.6-py2.7-win32.egg\jcc 
>>>>>> \__init__.pyc matches c:\Python27\lib\site-packages\jcc-2.6- 
>>>>>> py2.7-win32.egg\jcc\__init__.py
>>>>>> import jcc # precompiled from c:\Python27\lib\site-packages 
>>>>>> \jcc-2.6-py2.7-win32.egg\jcc\__init__.pyc
>>>>>> # c:\Python27\lib\site-packages\jcc-2.6-py2.7-win32.egg\jcc 
>>>>>> \config.pyc matches c:\Python27\lib\site-packages\jcc-2.6-py2.7-

>>>>>> win32.egg\jcc\config.py
>>>>>> import jcc.config # precompiled from c:\Python27\lib\site- 
>>>>>> packages\jcc-2.6-py2.7-win32.egg\jcc\config.pyc
>>>>>> c:\Python27\python.exe: DLL load failed: The specified module  
>>>>>> could not be found.
>>>>>>
>>>>>> So, what's in jcc/config.py?  Here's what's in it:
>>>>>>
>>>>>> INCLUDES=['C:\\Program Files (x86)\\Java\\jdk1.6.0_22\ 
>>>>>> \include', 'C:\\Program Files (x86)\\Java\\jdk1.6.0_22\\include\

>>>>>> \win32']
>>>>>> CFLAGS=['-fno-strict-aliasing', '-Wno-write-strings']
>>>>>> DEBUG_CFLAGS=['-O0', '-g', '-DDEBUG']
>>>>>> LFLAGS=['-LC:\\Program Files (x86)\\Java\\jdk1.6.0_22\\lib', '- 
>>>>>> ljvm']
>>>>>> IMPLIB_LFLAGS=['-Wl,--out-implib,%s']
>>>>>> SHARED=True
>>>>>> VERSION="2.6"
>>>>>>
>>>>>> Any ideas about what's going wrong?  I suspect those  
>>>>>> parentheses in the
>>>>>> path to the jvm, myself.
>>>>>>
>>>>>> Bill
>>>>>>
>>>

Mime
View raw message