Pip 正在回滚安装工具的卸载
Pip is rolling back uninstall of 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'
我不得不通过 ssh 进入服务器并且 运行
python -m pip install --upgrade -vv 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'
我不得不通过 ssh 进入服务器并且 运行
python -m pip install --upgrade -vv setuptools
然后我再次部署并且成功了。