ASi

CLIのOSXへのインストール

下記に説明がある。
http://docs.aws.amazon.com/ja_jp/streams/latest/dev/kinesis-tutorial-cli-installation.html

install pip


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

$ sudo python get-pip.py
Password:
The directory '/Users/someone/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/Users/someone/Library/Caches/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting pip
Downloading pip-9.0.1-py2.py3-none-any.whl (1.3MB)
100% |████████████████████████████████| 1.3MB 1.1MB/s
Collecting wheel
Downloading wheel-0.30.0-py2.py3-none-any.whl (49kB)
100% |████████████████████████████████| 51kB 9.3MB/s
Installing collected packages: pip, wheel
Successfully installed pip-9.0.1 wheel-0.30.0

install awscli

Amazaon の説明通りではエラーになった。同件↓
https://saku.io/failed-to-install-awscli-on-mac/


$ sudo pip install awscli
The directory '/Users/someone/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/Users/someone/Library/Caches/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting awscli
Downloading awscli-1.11.156-py2.py3-none-any.whl (1.2MB)
100% |████████████████████████████████| 1.2MB 1.2MB/s
Collecting PyYAML<=3.12,>=3.10 (from awscli)
Downloading PyYAML-3.12.tar.gz (253kB)
100% |████████████████████████████████| 256kB 4.6MB/s
Collecting rsa<=3.5.0,>=3.1.2 (from awscli)
Downloading rsa-3.4.2-py2.py3-none-any.whl (46kB)
100% |████████████████████████████████| 51kB 10.7MB/s
Collecting docutils>=0.10 (from awscli)
Downloading docutils-0.14-py2-none-any.whl (543kB)
100% |████████████████████████████████| 552kB 2.5MB/s
Collecting botocore==1.7.14 (from awscli)
Downloading botocore-1.7.14-py2.py3-none-any.whl (3.7MB)
100% |████████████████████████████████| 3.7MB 358kB/s
Collecting s3transfer<0.2.0,>=0.1.9 (from awscli)
Downloading s3transfer-0.1.11-py2.py3-none-any.whl (54kB)
100% |████████████████████████████████| 61kB 11.4MB/s
Collecting colorama<=0.3.7,>=0.2.5 (from awscli)
Downloading colorama-0.3.7-py2.py3-none-any.whl
Collecting pyasn1>=0.1.3 (from rsa<=3.5.0,>=3.1.2->awscli)
Downloading pyasn1-0.3.6-py2.py3-none-any.whl (63kB)
100% |████████████████████████████████| 71kB 11.2MB/s
Collecting jmespath<1.0.0,>=0.7.1 (from botocore==1.7.14->awscli)
Downloading jmespath-0.9.3-py2.py3-none-any.whl
Collecting python-dateutil<3.0.0,>=2.1 (from botocore==1.7.14->awscli)
Downloading python_dateutil-2.6.1-py2.py3-none-any.whl (194kB)
100% |████████████████████████████████| 194kB 6.0MB/s
Collecting futures<4.0.0,>=2.2.0; python_version == "2.6" or python_version == "2.7" (from s3transfer<0.2.0,>=0.1.9->awscli)
Downloading futures-3.1.1-py2-none-any.whl
Collecting six>=1.5 (from python-dateutil<3.0.0,>=2.1->botocore==1.7.14->awscli)
Downloading six-1.11.0-py2.py3-none-any.whl
Installing collected packages: PyYAML, pyasn1, rsa, docutils, jmespath, six, python-dateutil, botocore, futures, s3transfer, colorama, awscli
Running setup.py install for PyYAML ... done
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-7JcVq_-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/six-1.4.1-py2.7.egg-info'


下記で前掲のページの解決策に従い成功。pip への指示が違う。


$ sudo -H pip install awscli --upgrade --ignore-installed six
Password:
Collecting awscli
Using cached awscli-1.11.156-py2.py3-none-any.whl
Collecting six
Using cached six-1.11.0-py2.py3-none-any.whl
Collecting PyYAML<=3.12,>=3.10 (from awscli)
Downloading PyYAML-3.12.tar.gz (253kB)
100% |████████████████████████████████| 256kB 3.7MB/s
Collecting rsa<=3.5.0,>=3.1.2 (from awscli)
Downloading rsa-3.4.2-py2.py3-none-any.whl (46kB)
100% |████████████████████████████████| 51kB 7.4MB/s
Collecting docutils>=0.10 (from awscli)
Downloading docutils-0.14-py2-none-any.whl (543kB)
100% |████████████████████████████████| 552kB 2.2MB/s
Collecting botocore==1.7.14 (from awscli)
Using cached botocore-1.7.14-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)
Downloading pyasn1-0.3.6-py2.py3-none-any.whl (63kB)
100% |████████████████████████████████| 71kB 9.6MB/s
Collecting jmespath<1.0.0,>=0.7.1 (from botocore==1.7.14->awscli)
Downloading jmespath-0.9.3-py2.py3-none-any.whl
Collecting python-dateutil<3.0.0,>=2.1 (from botocore==1.7.14->awscli)
Using cached python_dateutil-2.6.1-py2.py3-none-any.whl
Collecting futures<4.0.0,>=2.2.0; python_version == "2.6" or python_version == "2.7" (from s3transfer<0.2.0,>=0.1.9->awscli)
Using cached futures-3.1.1-py2-none-any.whl
Building wheels for collected packages: PyYAML
Running setup.py bdist_wheel for PyYAML ... done
Stored in directory: /var/root/Library/Caches/pip/wheels/2c/f7/79/13f3a12cd723892437c0cfbde1230ab4d82947ff7b3839a4fc
Successfully built PyYAML
Installing collected packages: PyYAML, pyasn1, rsa, docutils, jmespath, six, python-dateutil, botocore, futures, s3transfer, colorama, awscli
Successfully installed PyYAML-3.12 awscli-1.11.156 botocore-1.7.14 colorama-0.3.7 docutils-0.14 futures-3.1.1 jmespath-0.9.3 pyasn1-0.3.6 python-dateutil-2.6.1 rsa-3.4.2 s3transfer-0.1.11 six-1.11.0