python - 使用 Python setuptools.command.sdist 导入错误

标签 python pip setuptools importerror

我正在尝试安装 Newspaper ,它使用 pip 安装了一大堆依赖项。在安装它的很多依赖项的过程中,出现了这个错误:

ImportError: <module 'setuptools.command.sdist' from '/usr/local/lib/python2.6/dist-packages/setuptools-10.0.1-py2.6.egg/setuptools/command/sdist.pyc'> has no '_default_revctrl' attribute

在没有 pip 的情况下安装工作正常,但由于 Newspaper 的依赖项数量而非常乏味。谁能帮帮我?

这是一个错误实例的完整回溯:

Complete output from command python setup.py egg_info:
    running egg_info
    creating pip-egg-info/Pillow.egg-info
    writing pip-egg-info/Pillow.egg-info/PKG-INFO
    writing top-level names to pip-egg-info/Pillow.egg-info/top_level.txt
    writing dependency_links to pip-egg-info/Pillow.egg-info/dependency_links.txt
    writing pip-egg-info/Pillow.egg-info/PKG-INFO
    writing top-level names to pip-egg-info/Pillow.egg-info/top_level.txt
    writing dependency_links to pip-egg-info/Pillow.egg-info/dependency_links.txt
    writing manifest file 'pip-egg-info/Pillow.egg-info/SOURCES.txt'
    warning: manifest_maker: standard file '-c' not found
    Traceback (most recent call last):
      File "<string>", line 20, in <module>
      File "/tmp/pip-build-auItlo/Pillow/setup.py", line 757, in <module>
        zip_safe=True,
      File "/usr/lib/python2.6/distutils/core.py", line 152, in setup
        dist.run_commands()
      File "/usr/lib/python2.6/distutils/dist.py", line 975, in run_commands
        self.run_command(cmd)
      File "/usr/lib/python2.6/distutils/dist.py", line 995, in run_command
        cmd_obj.run()
      File "<string>", line 15, in replacement_run
      File "/usr/local/lib/python2.6/dist-packages/setuptools-10.0.1-py2.6.egg/setuptools/command/egg_info.py", line 206, in find_sources
        mm.run()
      File "/usr/local/lib/python2.6/dist-packages/setuptools-10.0.1-py2.6.egg/setuptools/command/egg_info.py", line 290, in run
        self.add_defaults()
      File "/usr/local/lib/python2.6/dist-packages/setuptools-10.0.1-py2.6.egg/setuptools/command/egg_info.py", line 322, in add_defaults
        rcfiles = list(walk_revctrl())
      File "/usr/local/lib/python2.6/dist-packages/setuptools-10.0.1-py2.6.egg/setuptools/command/sdist.py", line 18, in walk_revctrl
        for item in ep.load()(dirname):
      File "/usr/local/lib/python2.6/dist-packages/setuptools-10.0.1-py2.6.egg/pkg_resources/__init__.py", line 2265, in load
        raise ImportError("%r has no %r attribute" % (entry, attr))
    ImportError: <module 'setuptools.command.sdist' from '/usr/local/lib/python2.6/dist-packages/setuptools-10.0.1-py2.6.egg/setuptools/command/sdist.pyc'> has no '_default_revctrl' attribute

最佳答案

这也可能是由于今天发布的设置工具发生了变化:

https://bitbucket.org/pypa/setuptools/issue/320/cannot-upgrade-to-1001

关于python - 使用 Python setuptools.command.sdist 导入错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27712889/

相关文章:

python - 如何在 VS code 中找到新安装的 python 模块?

python - 使用 python 中的列表推导就地修改列表的一部分

GemFury 包的 Python setup.py 依赖链接

python - 如何从 setup.py 中读取来自 pyproject.toml 的项目依赖项,以避免在两个文件中重复信息?

python - 如何对 numpy 数组中的多个变量求和?

python - 为什么使用 loc 和 slice 分配给数据帧与使用单个列不同?

python - 由于 ubuntu 服务器上的 PYTHONPATH,使用 pip 导入时出错

python - 使用 -e 选项从 github pip 安装到 virtualenv 无法将包添加到 python 路径

python - 如何告诉 setup.py 使用 Visual Studio

python - "UserWarning: Unbuilt egg for setuptools"- 这到底是什么意思?