ImportError: cannot import name Library, during installing PyLucene

白昼怎懂夜的黑 提交于 2019-12-08 01:41:04

问题


I have spent 5 hours to fix this problem but I can't. During installing PyLucene with 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.framework
Traceback (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 Library
ImportError: cannot import name Library
sanghee-m:jcc sanghee$ python setup.py build --debug
found JAVAFRAMEWORKS = /System/Library/Frameworks/JavaVM.framework
Traceback (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 Library
ImportError: 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?

Also, I installed setuptools 1.1.6 and used pylucene-4.4.0-1.

sanghee-m:jcc sanghee$ python
Python 2.7.5 (v2.7.5:ab05e7dd2788, May 13 2013, 13:18:45) 
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import setuptools

回答1:


I am trying to compile JCC under windows, and I found that the latest version of setuptools, 1.1.6, gives the import error you reported. However with version 0.6c11 the Library module is found.

Edit: 1.1.3 also works.




回答2:


it may seem like a stupid question but do you have the setuptools installed? https://pypi.python.org/pypi/setuptools/0.6c11



来源:https://stackoverflow.com/questions/19313208/importerror-cannot-import-name-library-during-installing-pylucene

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!