Mac 安裝 AWS-CLI

weixin_34249678發表於2017-10-17

Install

Python3

Download -> Install

$ python --version
Python 2.7.10

$ python3 --version
Python 3.6.3

$ curl -O https://bootstrap.pypa.io/get-pip.py
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 1558k  100 1558k    0     0   412k      0  0:00:03  0:00:03 --:--:--  412k

$ python3 get-pip.py --user
Requirement already up-to-date: pip in /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages
Collecting wheel
  Using cached wheel-0.30.0-py2.py3-none-any.whl
Installing collected packages: wheel
Successfully installed wheel-0.30.0

$ pip3 install awscli --upgrade --user
Collecting awscli
  Downloading awscli-1.11.171-py2.py3-none-any.whl (1.2MB)
    100% |████████████████████████████████| 1.2MB 1.1MB/s
Collecting s3transfer<0.2.0,>=0.1.9 (from awscli)
  Downloading s3transfer-0.1.11-py2.py3-none-any.whl (54kB)
    100% |████████████████████████████████| 61kB 3.2MB/s
Collecting docutils>=0.10 (from awscli)
  Downloading docutils-0.14-py3-none-any.whl (543kB)
    100% |████████████████████████████████| 552kB 2.4MB/s
Collecting colorama<=0.3.7,>=0.2.5 (from awscli)
  Downloading colorama-0.3.7-py2.py3-none-any.whl
Collecting PyYAML<=3.12,>=3.10 (from awscli)
  Downloading PyYAML-3.12.tar.gz (253kB)
    100% |████████████████████████████████| 256kB 797kB/s
Collecting botocore==1.7.29 (from awscli)
  Downloading botocore-1.7.29-py2.py3-none-any.whl (3.7MB)
    100% |████████████████████████████████| 3.7MB 169kB/s
Collecting rsa<=3.5.0,>=3.1.2 (from awscli)
  Downloading rsa-3.4.2-py2.py3-none-any.whl (46kB)
    100% |████████████████████████████████| 51kB 619kB/s
Collecting python-dateutil<3.0.0,>=2.1 (from botocore==1.7.29->awscli)
  Downloading python_dateutil-2.6.1-py2.py3-none-any.whl (194kB)
    100% |████████████████████████████████| 194kB 653kB/s
Collecting jmespath<1.0.0,>=0.7.1 (from botocore==1.7.29->awscli)
  Downloading jmespath-0.9.3-py2.py3-none-any.whl
Collecting pyasn1>=0.1.3 (from rsa<=3.5.0,>=3.1.2->awscli)
  Downloading pyasn1-0.3.7-py2.py3-none-any.whl (63kB)
    100% |████████████████████████████████| 71kB 648kB/s
Collecting six>=1.5 (from python-dateutil<3.0.0,>=2.1->botocore==1.7.29->awscli)
  Downloading six-1.11.0-py2.py3-none-any.whl
Building wheels for collected packages: PyYAML
  Running setup.py bdist_wheel for PyYAML ... done
  Stored in directory: /Users/username/Library/Caches/pip/wheels/2c/f7/79/13f3a12cd723892437c0cfbde1230ab4d82947ff7b3839a4fc
Successfully built PyYAML
Installing collected packages: docutils, six, python-dateutil, jmespath, botocore, s3transfer, colorama, PyYAML, pyasn1, rsa, awscli
Successfully installed PyYAML-3.12 awscli-1.11.171 botocore-1.7.29 colorama-0.3.7 docutils-0.14 jmespath-0.9.3 pyasn1-0.3.7 python-dateutil-2.6.1 rsa-3.4.2 s3transfer-0.1.11 six-1.11.0

awscli

# Add `/Users/username/Library/Python/3.6/bin` to PATH env.
> export PATH=/Users/username/Library/Python/3.6/bin:$PATH
$ source ~/.zshrc

$ aws --version
aws-cli/1.11.171 Python/3.6.3 Darwin/17.0.0 botocore/1.7.29