Pip正在回滚setuptools的卸载

时间:2017-07-25 15:04:37

标签: python django pip ansible setuptools

我使用this Ansible-Django堆栈将我的Django项目部署到AWS EC2实例。它工作了很长时间,但现在突然,我在部署时得到了以下错误。

似乎有一个新的setuptools版本未正确更新。

  • 为什么要回滚setuptools
  • 的卸载
  • 为什么不安装setuptools 36.2.2?

在我的要求中明确指定setuptools的版本可以解决此问题,但由于我只是间接依赖setuptools,因此我不应该知道要保留哪个版本。

Installing collected packages: shared-django, setuptools
  Found existing installation: shared-django 0.1.0
    Uninstalling shared-django-0.1.0:
      Successfully uninstalled shared-django-0.1.0
  Running setup.py install for shared-django: started
    Running setup.py install for shared-django: finished with status 'done'
  Found existing installation: setuptools 36.2.0
    Uninstalling setuptools-36.2.0:
      Successfully uninstalled setuptools-36.2.0
  Rolling back uninstall of setuptools

:stderr: Exception:
Traceback (most recent call last):
  File \"/webapps/CatalogService/lib/python3.5/site-packages/pip/basecommand.py\", line 215, in main
    status = self.run(options, args)
  File \"/webapps/CatalogService/lib/python3.5/site-packages/pip/commands/install.py\", line 342, in run
    prefix=options.prefix_path,
  File \"/webapps/CatalogService/lib/python3.5/site-packages/pip/req/req_set.py\", line 784, in install
    **kwargs
  File \"/webapps/CatalogService/lib/python3.5/site-packages/pip/req/req_install.py\", line 851, in install
    self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
  File \"/webapps/CatalogService/lib/python3.5/site-packages/pip/req/req_install.py\", line 1064, in move_wheel_files
    isolated=self.isolated,
  File \"/webapps/CatalogService/lib/python3.5/site-packages/pip/wheel.py\", line 247, in move_wheel_files
    prefix=prefix,
  File \"/webapps/CatalogService/lib/python3.5/site-packages/pip/locations.py\", line 140, in distutils_scheme
    d = Distribution(dist_args)
  File \"/webapps/CatalogService/lib/python3.5/site-packages/setuptools/dist.py\", line 365, in __init__
    self._finalize_requires()
  File \"/webapps/CatalogService/lib/python3.5/site-packages/setuptools/dist.py\", line 372, in _finalize_requires
    if not self.install_requires:
AttributeError: 'Distribution' object has no attribute 'install_requires'

1 个答案:

答案 0 :(得分:1)

我不得不进入服务器并运行

$site_settings

然后我再次部署并且有效。