2

When following the Install the AWS CLI Using the Bundled Installer (Linux, OS X, or Unix) directions I'm getting an error caused by what looks to be an incorrect file path file:///Users/jspooner/Downloads/awscli-bundle/packages awscli-1.7.24.tar.gz. I believe it should be packages/awscli. Is there python script broken or am I missing something?

➜  Downloads  python --version
Python 2.7.7
➜  Downloads  sudo ./awscli-bundle/install -i /usr/local/aws -b /usr/local/bin/aws
Password:
Running cmd: /usr/local/opt/python/bin/python2.7 virtualenv.py --python /usr/local/opt/python/bin/python2.7 /usr/local/aws
Running cmd: /usr/local/aws/bin/pip install --no-index --find-links file:///Users/jspooner/Downloads/awscli-bundle/packages awscli-1.7.24.tar.gz
Traceback (most recent call last):
  File "./awscli-bundle/install", line 138, in <module>
    main()
  File "./awscli-bundle/install", line 129, in main
    pip_install_packages(opts.install_dir)
  File "./awscli-bundle/install", line 98, in pip_install_packages
    pip_script, PACKAGES_DIR, cli_tarball))
  File "./awscli-bundle/install", line 44, in run
    p.returncode, cmd, stdout + stderr))
__main__.BadRCError: Bad rc (1) for cmd '/usr/local/aws/bin/pip install --no-index --find-links file:///Users/jspooner/Downloads/awscli-bundle/packages awscli-1.7.24.tar.gz': Traceback (most recent call last):
  File "/usr/local/aws/bin/pip", line 9, in <module>
    load_entry_point('pip==1.4.1', 'console_scripts', 'pip')()
  File "/usr/local/aws/lib/python2.7/site-packages/pkg_resources.py", line 378, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/local/aws/lib/python2.7/site-packages/pkg_resources.py", line 2566, in load_entry_point
    return ep.load()
  File "/usr/local/aws/lib/python2.7/site-packages/pkg_resources.py", line 2260, in load
    entry = __import__(self.module_name, globals(),globals(), ['__name__'])
  File "/usr/local/aws/lib/python2.7/site-packages/pip/__init__.py", line 10, in <module>
    from pip.util import get_installed_distributions, get_prog
  File "/usr/local/aws/lib/python2.7/site-packages/pip/util.py", line 17, in <module>
    from pip.vendor.distlib import version
  File "/usr/local/aws/lib/python2.7/site-packages/pip/vendor/distlib/version.py", line 13, in <module>
    from .compat import string_types
  File "/usr/local/aws/lib/python2.7/site-packages/pip/vendor/distlib/compat.py", line 31, in <module>
    from urllib2 import (Request, urlopen, URLError, HTTPError,
ImportError: cannot import name HTTPSHandler

3 Answers 3

14

Try navigating to the /tmp directory before running amazon's 3 installation commands, rather than running these commands from within your own user folder. I'm not sure why this extra step is required for some OS X installations.

cd /tmp
curl -o awscli.zip https://s3.amazonaws.com/aws-cli/awscli-bundle.zip
unzip awscli.zip
sudo ./awscli-bundle/install -i /usr/local/aws -b /usr/local/bin/aws
Sign up to request clarification or add additional context in comments.

2 Comments

Worked great :). Wonderfull suggestion.
running it from /tmp directory installs awscli using default OSX python, which is 2.7.x. Not sure why it is not pointing to latest version of python, i.e 3.7.x
0

Install PiP and use the following command

 pip install awscli --upgrade --user

Comments

-2

I would highly recommend installing awscli from Homebrew package manager if you are on OS X.

1 Comment

This is not recommended by Amazon anymore: "The awscli package may be available in repositories for other package managers such as APT, yum and Homebrew, but it is not guaranteed to be the latest version. To make sure you have the latest version, use one of the installation methods described here." docs.aws.amazon.com/cli/latest/userguide/installing.html

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.