我没有在 Google 上找到任何关于此问题的参考资料,但我在数十个 AWS EC2 CentOS 实例上都遇到了这个问题。如果 awscli 尚不存在,则可以正常安装。但是,从 v1.4.3 开始,任何升级到 >=1.4.4 ( 'pip install --upgrade awscli'
) 的尝试都会导致以下错误:
Downloading/unpacking awscli from https://pypi.python.org/packages/source/a/awscli/awscli-1.4.4.tar.gz#md5=3e9defe3470db63b88f91ab236dcfec2
Running setup.py egg_info for package awscli
warning: no files found matching 'LICENSE.txt'
warning: no files found matching 'requirements.txt'
warning: no files found matching '*.rst' under directory 'awscli/examples'
warning: no files found matching '*.json' under directory 'awscli/data'
Requirement already up-to-date: botocore>=0.63.0,<0.64.0 in /usr/lib/python2.6/site-packages (from awscli)
Requirement already up-to-date: bcdoc>=0.12.0,<0.13.0 in /usr/lib/python2.6/site-packages (from awscli)
Requirement already up-to-date: six>=1.1.0 in /usr/lib/python2.6/site-packages (from awscli)
Requirement already up-to-date: colorama==0.2.5 in /usr/lib/python2.6/site-packages (from awscli)
Requirement already up-to-date: docutils>=0.10 in /usr/lib/python2.6/site-packages (from awscli)
Requirement already up-to-date: rsa==3.1.2 in /usr/lib/python2.6/site-packages (from awscli)
Requirement already up-to-date: argparse>=1.1 in /usr/lib/python2.6/site-packages (from awscli)
Requirement already up-to-date: jmespath==0.4.1 in /usr/lib/python2.6/site-packages (from botocore>=0.63.0,<0.64.0->awscli)
Requirement already up-to-date: python-dateutil>=2.1 in /usr/lib/python2.6/site-packages (from botocore>=0.63.0,<0.64.0->awscli)
Requirement already up-to-date: ordereddict==1.1 in /usr/lib/python2.6/site-packages (from botocore>=0.63.0,<0.64.0->awscli)
Requirement already up-to-date: simplejson==3.3.0 in /usr/lib/python2.6/site-packages (from botocore>=0.63.0,<0.64.0->awscli)
Requirement already up-to-date: pyasn1>=0.1.3 in /usr/lib/python2.6/site-packages (from rsa==3.1.2->awscli)
Installing collected packages: awscli
Found existing installation: awscli 1.4.3
Uninstalling awscli:
Successfully uninstalled awscli
Running setup.py install for awscli
error: file '/tmp/pip-build-root/awscli/bin/aws' does not exist
Complete output from command /usr/bin/python -c "import setuptools;__file__='/tmp/pip-build-root/awscli/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-V1jT9z-record/install-record.txt --single-version-externally-managed:
running install
running build
running build_scripts
error: file '/tmp/pip-build-root/awscli/bin/aws' does not exist
----------------------------------------
Rolling back uninstall of awscli
Command /usr/bin/python -c "import setuptools;__file__='/tmp/pip-build-root/awscli/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-V1jT9z-record/install-record.txt --single-version-externally-managed failed with error code 1 in /tmp/pip-build-root/awscli
Storing complete log in /root/.pip/pip.log
然后,从 /root/.pip/pip.log:
Running setup.py install for awscli
Running command /usr/bin/python -c "import setuptools;__file__='/tmp/pip-build-root/awscli/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-1n2lji-record/install-record.txt --single-version-externally-managed
running install
running build
running build_scripts
error: file '/tmp/pip-build-root/awscli/bin/aws' does not exist
在aws版本升级1.4.3 -> 1.4.4、1.4.3 -> 1.5.0和1.4.4 -> 1.5.0的机器上也会出现同样的错误。
答案1
事实证明,如果我尝试直接升级 awscli 的其他依赖项,它们不会升级,每个依赖项都会因相同的基本问题而失败。我不确定问题到底是什么,但删除文件夹/tmp/pip-build-root
解决了所有问题。