Monday, July 31, 2017

How to install AWS CLI in Mac ?

Steps:

1) Install latest version of Python (https://www.python.org/downloads/)

$ python3

Python 3.6.2 (v3.6.2:5fd33b5926, Jul 16 2017, 20:11:06) 
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.

>>> 

2) Install PIP (Python Package Index)

i) curl -O https://bootstrap.pypa.io/get-pip.py

$ 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   419k      0  0:00:03  0:00:03 --:--:--  419k
$ ls get-pip.py 
get-pip.py


ii) python3 get-pip.py --user

$ 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
  Downloading wheel-0.29.0-py2.py3-none-any.whl (66kB)
    100% |████████████████████████████████| 71kB 544kB/s 
Installing collected packages: wheel

Successfully installed wheel-0.29.0
$ pip3 --version
pip 9.0.1 from /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages (python 3.6)


3) Install AWS CLI using PIP

pip3 install --user --upgrade awscli

$ pip3 install --user --upgrade awscli
Collecting awscli
  Downloading awscli-1.11.127-py2.py3-none-any.whl (1.2MB)
    100% |████████████████████████████████| 1.2MB 
....
....

Building wheels for collected packages: PyYAML
  Running setup.py bdist_wheel for PyYAML ... done
  Stored in directory: /Users/raja/Library/Caches/pip/wheels/2c/f7/79/13f3a12cd723892437c0cfbde1230ab4d82947ff7b3839a4fc
Successfully built PyYAML
Installing collected packages: docutils, colorama, jmespath, six, python-dateutil, botocore, pyasn1, rsa, s3transfer, PyYAML, awscli

Successfully installed PyYAML-3.12 awscli-1.11.127 botocore-1.5.90 colorama-0.3.7 docutils-0.13.1 jmespath-0.9.3 pyasn1-0.3.1 python-dateutil-2.6.1 rsa-3.4.2 s3transfer-0.1.10 six-1.10.0

4) Verify AWS CLI installation

$ aws
-bash: aws: command not found


Here in my case executable is not found, so need to add the aws executable to OS's PATH environment variable.

Following is the path.
$ ~/Library/Python/3.6/bin/
__pycache__/           aws_zsh_completer.sh   pyrsa-encrypt-bigfile  rst2html.py            rst2odt_prepstyles.py  rstpep2html.py
aws                    jp.py                  pyrsa-keygen           rst2html5.py           rst2pseudoxml.py       wheel
aws.cmd                pyrsa-decrypt          pyrsa-priv2pub         rst2latex.py           rst2s5.py              
aws_bash_completer     pyrsa-decrypt-bigfile  pyrsa-sign             rst2man.py             rst2xetex.py        
aws_completer          pyrsa-encrypt          pyrsa-verify           rst2odt.py             rst2xml.py             


In this example i am adding the path to my "bash_profile" (~/.bash_profile)


PATH="~/Library/Python/3.6/bin:$PATH"

$ source ~/.bash_profile
Type aws as command to verify.

$ aws
usage: aws [options] <command> <subcommand> [<subcommand> ...] [parameters]
To see help text, you can run:

  aws help
  aws <command> help
  aws <command> <subcommand> help

aws: error: the following arguments are required: command

** AWS CLI is installed successfully **








6 comments:

  1. Those guidelines additionally worked to become a good way to
    recognize that other people online have the identical fervor like mine
    to grasp great deal more around this condition.



    aws training in bangalore



    aws training in chennai

    ReplyDelete
  2. Thanks for the information sharing with us.it is very simple and easily understand.keep posting these type of good content.Thank you...
    aws online training
    aws training in hyderabad
    amazon web services(AWS) online training

    ReplyDelete
  3. This comment has been removed by the author.

    ReplyDelete

  4. I’m not sure where you’re getting your information, but good topic. I need to spend some time learning more or understanding more.
    Thanks for fantastic info I was looking for this information for my mission.

    AWS training in chennai | AWS training in anna nagar | AWS training in omr | AWS training in porur | AWS training in tambaram | AWS training in velachery

    ReplyDelete

  5. This was a very informative article, indeed loved to read and clear my doubts. Keep us posted a lot more blogs. Also check out our blog pages too.

    data science training in chennai

    ccna training in chennai

    iot training in chennai

    cyber security training in chennai

    ethical hacking training in chennai

    ReplyDelete