python setuptools: ImportError: cannot import name Library

假装没事ソ 提交于 2019-12-06 05:46:49

In old versions of setuptools, the Library class was imported into the setuptools package. This hasn't been the case since version 1.1.

That setup.py script is written against an older version of setuptools than you have installed.

You should be able to fix it by editing setup.py and changing the import to:

from setuptools.extension import Library

Post installation

For this particular package in Windows it seems to install the built DLL to the site-packages directory. Once installed, edit mgrs\core.py and replace the line:

local_dlls = os.path.abspath(os.__file__ + "../../../DLLs")

With:

import site
local_dlls = ";".join(site.getsitepackages())
Mike Driscoll

Check and make sure you have the latest version of SetupTools installed. Previous posts about this issue were linked to having a screwy version of SetupTools on the machine. Also, you might want to try pip instead of easy_install as it's a bit better.

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