aws-cliコマンドエラーの復旧　ImportError: No module named six.moves/ImportError: No module named jmespath

# ◆ 今日の困ったこと

aws-cliコマンドが動かない？
- ImportError: No module named six.moves
- ImportError: No module named jmespath

# ◆ バージョン

- MacOS 10.11.6

- python 2.7.13

```bash

10:28:07 repl_test/  $ python
Python 2.7.13 (default, Dec 17 2016, 23:03:43)
[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.42.1)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
```

# ◆ 解決

```bash

$ easy_install six

$ sudo pip install awscli --force-reinstall --upgrade
```

# ◆ エラーの内容

- ImportError: No module named six.moves

```bash
10:26:45 repl_test/  $ aws ecr get-login --region ap-northeast-1
Traceback (most recent call last):
  File "/usr/local/bin/aws", line 19, in <module>
    import awscli.clidriver
  File "/usr/local/lib/python2.7/site-packages/awscli/clidriver.py", line 17, in <module>
    import botocore.session
  File "/usr/local/lib/python2.7/site-packages/botocore/session.py", line 25, in <module>
    import botocore.configloader
  File "/usr/local/lib/python2.7/site-packages/botocore/configloader.py", line 18, in <module>
    from six.moves import configparser
ImportError: No module named six.moves

```

- モジュールがないならインストールしてみる

```bash

10:27:39 repl_test/  $ easy_install six
Searching for six
Reading https://pypi.python.org/simple/six/
Downloading https://pypi.python.org/packages/b3/b2/238e2590826bfdd113244a40d9d3eb26918bd798fc187e2360a8367068db/six-1.10.0.tar.gz#md5=34eed507548117b2ab523ab14b2f8b55
Best match: six 1.10.0
Processing six-1.10.0.tar.gz
Writing /var/folders/b5/7qr6mwxd59nbtmdr6p7vl3vm0000gn/T/easy_install-IGfcMo/six-1.10.0/setup.cfg
Running six-1.10.0/setup.py -q bdist_egg --dist-dir /var/folders/b5/7qr6mwxd59nbtmdr6p7vl3vm0000gn/T/easy_install-IGfcMo/six-1.10.0/egg-dist-tmp-cXsmla
no previously-included directories found matching 'documentation/_build'
zip_safe flag not set; analyzing archive contents...
six: module references __path__
creating /usr/local/lib/python2.7/site-packages/six-1.10.0-py2.7.egg
Extracting six-1.10.0-py2.7.egg to /usr/local/lib/python2.7/site-packages
Adding six 1.10.0 to easy-install.pth file

Installed /usr/local/lib/python2.7/site-packages/six-1.10.0-py2.7.egg
Processing dependencies for six
Finished processing dependencies for six

```

- 今度は　ImportError: No module named jmespath


```bash
10:28:04 repl_test/  $ aws
Traceback (most recent call last):
  File "/usr/local/bin/aws", line 19, in <module>
    import awscli.clidriver
  File "/usr/local/lib/python2.7/site-packages/awscli/clidriver.py", line 17, in <module>
    import botocore.session
  File "/usr/local/lib/python2.7/site-packages/botocore/session.py", line 27, in <module>
    import botocore.client
  File "/usr/local/lib/python2.7/site-packages/botocore/client.py", line 16, in <module>
    from botocore import waiter, xform_name
  File "/usr/local/lib/python2.7/site-packages/botocore/waiter.py", line 13, in <module>
    import jmespath
ImportError: No module named jmespath

```


- 解決の手がかり
    - [Exceptions with the latest release #641](https://github.com/aws/aws-cli/issues/641)

```bash

10:28:59 repl_test/  $ sudo pip install awscli --force-reinstall --upgrade


```

使えるようになりました。
同じく困った人がいれば。