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 SangHee Kim <sa...@gmail.com> on 2013/10/11 10:17:53 UTC

ImportError: cannot import name Library, during installing PyLucene

Hi everyone!

I have spent 5 hours to fix this problem but I can't. During installing
PyLucene withhttp://lucene.apache.org/pylucene/install.htmt , I faced with
a error like follwing.

sanghee-m:jcc sanghee$ python setup.py build
found JAVAFRAMEWORKS =
/System/Library/Frameworks/JavaVM.frameworkTraceback (most recent call
last):
  File "setup.py", line 398, in <module>
    main('--debug' in sys.argv)
  File "setup.py", line 306, in main
    from setuptools import LibraryImportError: cannot import name Library
sanghee-m:jcc sanghee$ python setup.py build --debug
found JAVAFRAMEWORKS =
/System/Library/Frameworks/JavaVM.frameworkTraceback (most recent call
last):
  File "setup.py", line 398, in <module>
    main('--debug' in sys.argv)
  File "setup.py", line 306, in main
    from setuptools import LibraryImportError: cannot import name Library
sanghee-m:jcc sanghee$

I can't find Library also. How can I solve this problme? Can you let me
know where should I check when I get this kind of error?

I uses setuptools 1.1.6 and pylucene-4.4.0-1.

-- 
SangHee Kim
http://goo.gl/LnpDX

Re: ImportError: cannot import name Library, during installing PyLucene

Posted by SangHee Kim <sa...@gmail.com>.
Hi Andi,

Thanks! I summarized the steps at the follwing link.

https://medium.com/small-talk/e1e90a2b129f

I think anybody may need to mention about the point to PyLucene installtion
guide to avoid my case.

http://lucene.apache.org/pylucene/install.html


On Sat, Oct 12, 2013 at 11:22 PM, Andi Vajda <va...@apache.org> wrote:

>
> > On Oct 12, 2013, at 17:42, SangHee Kim <sa...@gmail.com> wrote:
> >
> > Hi Andi,
> >
> > I have tested building and installing pylucene 4.5 with setuptools 1.1.6
> and it works. Thanks!
>
> Cool, thank you for verifying the fix.
>
> Andi..
>
> >
> > a. Code of pylucene I used :
> http://svn.apache.org/viewvc/lucene/pylucene/branches/pylucene_4_5/
> > b. Setuptools version : setuptools-1.1.6-py2.7.egg
> >
> >
> >> On Fri, Oct 11, 2013 at 3:15 PM, Andi Vajda <va...@apache.org> wrote:
> >>
> >> On Fri, 11 Oct 2013, SangHee Kim wrote:
> >>
> >>> Hi everyone!
> >>>
> >>> I have spent 5 hours to fix this problem but I can't. During installing
> >>> PyLucene withhttp://lucene.apache.org/pylucene/install.htmt , I faced
> with
> >>> a error like follwing.
> >>>
> >>> sanghee-m:jcc sanghee$ python setup.py build
> >>> found JAVAFRAMEWORKS =
> >>> /System/Library/Frameworks/JavaVM.frameworkTraceback (most recent call
> >>>
> >>> last):
> >>>  File "setup.py", line 398, in <module>
> >>>    main('--debug' in sys.argv)
> >>>  File "setup.py", line 306, in main
> >>>    from setuptools import LibraryImportError: cannot import name
> Library
> >>
> >> Indeed, there are two problems with setuptools 1.1.6, apparently:
> >>   1. the Library class is only accessible via setuptools.extension
> >>   2. the logic in setuptools.command.build_ext patching in
> darwin-specific
> >>      options for building a shared library into _CONFIG_VARS is broken
> >>
> >> I added code to JCC's setup.py to workaround both issues.
> >> This is checked into rev 1531420 in pylucene's trunk.
> >>
> >> Please, refresh your copy of JCC from pylucene's trunk (still called
> 2.17), rebuild and reinstall it and try your pylucene 4.4.0 build again.
> >> Please, let me know if this solves the problem for you as well.
> >>
> >> Andi..
> >
> >
> >
> > --
> > SangHee Kim
> > http://goo.gl/LnpDX
>



-- 
SangHee Kim
http://goo.gl/LnpDX

Re: ImportError: cannot import name Library, during installing PyLucene

Posted by Andi Vajda <va...@apache.org>.
> On Oct 12, 2013, at 17:42, SangHee Kim <sa...@gmail.com> wrote:
> 
> Hi Andi,
> 
> I have tested building and installing pylucene 4.5 with setuptools 1.1.6 and it works. Thanks!

Cool, thank you for verifying the fix.

Andi..

> 
> a. Code of pylucene I used : http://svn.apache.org/viewvc/lucene/pylucene/branches/pylucene_4_5/
> b. Setuptools version : setuptools-1.1.6-py2.7.egg
> 
> 
>> On Fri, Oct 11, 2013 at 3:15 PM, Andi Vajda <va...@apache.org> wrote:
>> 
>> On Fri, 11 Oct 2013, SangHee Kim wrote:
>> 
>>> Hi everyone!
>>> 
>>> I have spent 5 hours to fix this problem but I can't. During installing
>>> PyLucene withhttp://lucene.apache.org/pylucene/install.htmt , I faced with
>>> a error like follwing.
>>> 
>>> sanghee-m:jcc sanghee$ python setup.py build
>>> found JAVAFRAMEWORKS =
>>> /System/Library/Frameworks/JavaVM.frameworkTraceback (most recent call
>>> 
>>> last):
>>>  File "setup.py", line 398, in <module>
>>>    main('--debug' in sys.argv)
>>>  File "setup.py", line 306, in main
>>>    from setuptools import LibraryImportError: cannot import name Library
>> 
>> Indeed, there are two problems with setuptools 1.1.6, apparently:
>>   1. the Library class is only accessible via setuptools.extension
>>   2. the logic in setuptools.command.build_ext patching in darwin-specific
>>      options for building a shared library into _CONFIG_VARS is broken
>> 
>> I added code to JCC's setup.py to workaround both issues.
>> This is checked into rev 1531420 in pylucene's trunk.
>> 
>> Please, refresh your copy of JCC from pylucene's trunk (still called 2.17), rebuild and reinstall it and try your pylucene 4.4.0 build again.
>> Please, let me know if this solves the problem for you as well.
>> 
>> Andi..
> 
> 
> 
> -- 
> SangHee Kim
> http://goo.gl/LnpDX

Re: ImportError: cannot import name Library, during installing PyLucene

Posted by SangHee Kim <sa...@gmail.com>.
Hi Andi,

I have tested building and installing pylucene 4.5 with setuptools 1.1.6
and it works. Thanks!

a. Code of pylucene I used :
http://svn.apache.org/viewvc/lucene/pylucene/branches/pylucene_4_5/
b. Setuptools version : setuptools-1.1.6-py2.7.egg


On Fri, Oct 11, 2013 at 3:15 PM, Andi Vajda <va...@apache.org> wrote:

>
> On Fri, 11 Oct 2013, SangHee Kim wrote:
>
>  Hi everyone!
>>
>> I have spent 5 hours to fix this problem but I can't. During installing
>> PyLucene withhttp://lucene.apache.org/**pylucene/install.htmt<http://lucene.apache.org/pylucene/install.htmt>, I faced with
>> a error like follwing.
>>
>> sanghee-m:jcc sanghee$ python setup.py build
>> found JAVAFRAMEWORKS =
>> /System/Library/Frameworks/**JavaVM.frameworkTraceback (most recent call
>>
>> last):
>>  File "setup.py", line 398, in <module>
>>    main('--debug' in sys.argv)
>>  File "setup.py", line 306, in main
>>    from setuptools import LibraryImportError: cannot import name Library
>>
>
> Indeed, there are two problems with setuptools 1.1.6, apparently:
>   1. the Library class is only accessible via setuptools.extension
>   2. the logic in setuptools.command.build_ext patching in darwin-specific
>      options for building a shared library into _CONFIG_VARS is broken
>
> I added code to JCC's setup.py to workaround both issues.
> This is checked into rev 1531420 in pylucene's trunk.
>
> Please, refresh your copy of JCC from pylucene's trunk (still called
> 2.17), rebuild and reinstall it and try your pylucene 4.4.0 build again.
> Please, let me know if this solves the problem for you as well.
>
> Andi..
>



-- 
SangHee Kim
http://goo.gl/LnpDX

Re: ImportError: cannot import name Library, during installing PyLucene

Posted by Andi Vajda <va...@apache.org>.
On Fri, 11 Oct 2013, SangHee Kim wrote:

> Hi everyone!
>
> I have spent 5 hours to fix this problem but I can't. During installing
> PyLucene withhttp://lucene.apache.org/pylucene/install.htmt , I faced with
> a error like follwing.
>
> sanghee-m:jcc sanghee$ python setup.py build
> found JAVAFRAMEWORKS =
> /System/Library/Frameworks/JavaVM.frameworkTraceback (most recent call
> last):
>  File "setup.py", line 398, in <module>
>    main('--debug' in sys.argv)
>  File "setup.py", line 306, in main
>    from setuptools import LibraryImportError: cannot import name Library

Indeed, there are two problems with setuptools 1.1.6, apparently:
   1. the Library class is only accessible via setuptools.extension
   2. the logic in setuptools.command.build_ext patching in darwin-specific
      options for building a shared library into _CONFIG_VARS is broken

I added code to JCC's setup.py to workaround both issues.
This is checked into rev 1531420 in pylucene's trunk.

Please, refresh your copy of JCC from pylucene's trunk (still called 2.17), 
rebuild and reinstall it and try your pylucene 4.4.0 build again.
Please, let me know if this solves the problem for you as well.

Andi..