简体   繁体   中英

update to the latest version of the AWS CLI tool

recently noticed that I am running an old version of AWS CLI that is lacking some functionality I need. I tried to install the last version with the next commands, but I got an error. I tried the same without sudo -H with the same error. I also tried before 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'

I also tried:

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 "','"

Try this:

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

This should work around the "Uninstalling a distutils installed project (six) has been deprecated" problem. It looks like the underlying issue has been fixed recently, as I haven't had to use the --ignore-installed option for the last few upgrades.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM