gpt4 book ai didi

python - 更新到最新版本的 AWS CLI 工具

转载 作者:太空宇宙 更新时间:2023-11-03 14:42:58 24 4
gpt4 key购买 nike

最近注意到我正在运行旧版本的 AWS CLI,它缺少一些我需要的功能。我尝试使用以下命令安装最新版本,但出现错误。我在没有 sudo -H 的情况下尝试了相同的操作,但出现了相同的错误。我之前也尝试过 sudo -H pip install --upgrade pip

MacBook-Pro-de-lopes: lopes$ sudo -H pip install --upgrade awscli
Password:
Collecting awscli
Using cached awscli-1.11.160-py2.py3-none-any.whl
Collecting PyYAML<=3.12,>=3.10 (from awscli)
Collecting rsa<=3.5.0,>=3.1.2 (from awscli)
Using cached rsa-3.4.2-py2.py3-none-any.whl
Collecting docutils>=0.10 (from awscli)
Using cached docutils-0.14-py2-none-any.whl
Collecting botocore==1.7.18 (from awscli)
Using cached botocore-1.7.18-py2.py3-none-any.whl
Collecting s3transfer<0.2.0,>=0.1.9 (from awscli)
Using cached s3transfer-0.1.11-py2.py3-none-any.whl
Collecting colorama<=0.3.7,>=0.2.5 (from awscli)
Using cached colorama-0.3.7-py2.py3-none-any.whl
Collecting pyasn1>=0.1.3 (from rsa<=3.5.0,>=3.1.2->awscli)
Using cached pyasn1-0.3.6-py2.py3-none-any.whl
Requirement already up-to-date: jmespath<1.0.0,>=0.7.1 in /Library/Python/2.7/site-packages (from botocore==1.7.18->awscli)
Collecting python-dateutil<3.0.0,>=2.1 (from botocore==1.7.18->awscli)
Using cached python_dateutil-2.6.1-py2.py3-none-any.whl
Requirement already up-to-date: futures<4.0.0,>=2.2.0; python_version == "2.6" or python_version == "2.7" in /Library/Python/2.7/site-packages (from s3transfer<0.2.0,>=0.1.9->awscli)
Collecting six>=1.5 (from python-dateutil<3.0.0,>=2.1->botocore==1.7.18->awscli)
Using cached six-1.11.0-py2.py3-none-any.whl
Installing collected packages: PyYAML, pyasn1, rsa, docutils, six, python-dateutil, botocore, s3transfer, colorama, awscli
Found existing installation: six 1.4.1
DEPRECATION: Uninstalling a distutils installed project (six) has been deprecated and will be removed in a future version. This is due to the fact that uninstalling a distutils project will only partially uninstall the project.
Uninstalling six-1.4.1:
Exception:
Traceback (most recent call last):
File "/Library/Python/2.7/site-packages/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/Library/Python/2.7/site-packages/pip/commands/install.py", line 342, in run
prefix=options.prefix_path,
File "/Library/Python/2.7/site-packages/pip/req/req_set.py", line 778, in install
requirement.uninstall(auto_confirm=True)
File "/Library/Python/2.7/site-packages/pip/req/req_install.py", line 754, in uninstall
paths_to_remove.remove(auto_confirm)
File "/Library/Python/2.7/site-packages/pip/req/req_uninstall.py", line 115, in remove
renames(path, new_path)
File "/Library/Python/2.7/site-packages/pip/utils/__init__.py", line 267, in renames
shutil.move(old, new)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 302, in move
copy2(src, real_dst)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 131, in copy2
copystat(src, dst)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 103, in copystat
os.chflags(dst, st.st_flags)
OSError: [Errno 1] Operation not permitted: '/tmp/pip-VB3Shu-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/six-1.4.1-py2.7.egg-info'

我也尝试过:

sudo -H python -m pip install --upgrade pip,
Password:
Invalid requirement: 'pip,'
Traceback (most recent call last):
File "/Library/Python/2.7/site-packages/pip/req/req_install.py", line 82, in __init__
req = Requirement(req)
File "/Library/Python/2.7/site-packages/pip/_vendor/packaging/requirements.py", line 96, in __init__
requirement_string[e.loc:e.loc + 8]))
InvalidRequirement: Invalid requirement, parse error at "','"

最佳答案

试试这个:

sudo -H pip install --upgrade awscli --ignore-installed 6

这应该可以解决“卸载已安装的 distutils 项目(六)已被弃用”的问题。看起来根本问题最近已得到解决,因为我在最近几次升级中不必使用 --ignore-installed 选项。

关于python - 更新到最新版本的 AWS CLI 工具,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46455502/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com