AWS CLIのインストールを実施しましたが少しエラーなど出たのでメモなど。
改めてAWS CLIのインストール要件は以下となります。
・Python2 バージョン 2.6.5 以上、またはPython3 バージョン 3.3 以上
今回、色々検証しますがAWS CLIの環境などは独自にしておきたいのでVagrant上のUbuntuで実施。
OSのバージョンなど。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
$ cat /etc/os-release NAME="Ubuntu" VERSION="16.04.4 LTS (Xenial Xerus)" ID=ubuntu ID_LIKE=debian PRETTY_NAME="Ubuntu 16.04.4 LTS" VERSION_ID="16.04" HOME_URL="http://www.ubuntu.com/" SUPPORT_URL="http://help.ubuntu.com/" BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/" VERSION_CODENAME=xenial UBUNTU_CODENAME=xenial vagrant@vagrant:~$ vagrant@vagrant:~$ cat /etc/os-release NAME="Ubuntu" VERSION="16.04.4 LTS (Xenial Xerus)" ID=ubuntu ID_LIKE=debian PRETTY_NAME="Ubuntu 16.04.4 LTS" VERSION_ID="16.04" HOME_URL="http://www.ubuntu.com/" SUPPORT_URL="http://help.ubuntu.com/" BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/" VERSION_CODENAME=xenial UBUNTU_CODENAME=xenial |
あ、ちと古い。
Pythonのバージョンも確認。
1 2 3 4 |
$ python --version Python 2.7.10 |
AWS CLIを入れるのは大丈夫でしょう。
ということでインストールです。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
$ pip install awscli --upgrade --user Collecting awscli Downloading https://files.pythonhosted.org/packages/2a/2a/e5ae9191c388db103bc197a444260c8fd4f4f44a8183eb922cd5ebf183cf/awscli-1.15.85-py2.py3-none-any.whl (1.3MB) 100% |████████████████████████████████| 1.3MB 8.2MB/s Requirement not upgraded as not directly required: PyYAML<=3.13,>=3.10 in ./.local/lib/python3.5/site-packages (from awscli) (3.12) Collecting rsa<=3.5.0,>=3.1.2 (from awscli) Downloading https://files.pythonhosted.org/packages/e1/ae/baedc9cb175552e95f3395c43055a6a5e125ae4d48a1d7a924baca83e92e/rsa-3.4.2-py2.py3-none-any.whl (46kB) 100% |████████████████████████████████| 51kB 11.5MB/s Requirement not upgraded as not directly required: colorama<=0.3.9,>=0.2.5 in ./.local/lib/python3.5/site-packages (from awscli) (0.3.9) Requirement not upgraded as not directly required: docutils>=0.10 in ./.local/lib/python3.5/site-packages (from awscli) (0.14) Collecting botocore==1.10.84 (from awscli) Downloading https://files.pythonhosted.org/packages/01/b7/cb08cd1af2bb0d0dfb393101a93b6ab6fb80f109ab7b37f2f34386c11351/botocore-1.10.84-py2.py3-none-any.whl (4.5MB) 100% |████████████████████████████████| 4.5MB 6.6MB/s Collecting s3transfer<0.2.0,>=0.1.12 (from awscli) Downloading https://files.pythonhosted.org/packages/d7/14/2a0004d487464d120c9fb85313a75cd3d71a7506955be458eebfe19a6b1d/s3transfer-0.1.13-py2.py3-none-any.whl (59kB) 100% |████████████████████████████████| 61kB 12.6MB/s Collecting pyasn1>=0.1.3 (from rsa<=3.5.0,>=3.1.2->awscli) Downloading https://files.pythonhosted.org/packages/d1/a1/7790cc85db38daa874f6a2e6308131b9953feb1367f2ae2d1123bb93a9f5/pyasn1-0.4.4-py2.py3-none-any.whl (72kB) 100% |████████████████████████████████| 81kB 3.3MB/s Requirement not upgraded as not directly required: python-dateutil<3.0.0,>=2.1; python_version >= "2.7" in ./.local/lib/python3.5/site-packages (from botocore==1.10.84->awscli) (2.7.3) Requirement not upgraded as not directly required: jmespath<1.0.0,>=0.7.1 in ./.local/lib/python3.5/site-packages (from botocore==1.10.84->awscli) (0.9.3) Requirement not upgraded as not directly required: six>=1.5 in ./.local/lib/python3.5/site-packages (from python-dateutil<3.0.0,>=2.1; python_version >= "2.7"->botocore==1.10.84->awscli) (1.11.0) docker 3.4.1 has requirement requests!=2.18.0,>=2.14.2, but you'll have requests 2.9.1 which is incompatible. Installing collected packages: pyasn1, rsa, botocore, s3transfer, awscli Found existing installation: botocore 1.10.59 Uninstalling botocore-1.10.59: Successfully uninstalled botocore-1.10.59 Successfully installed awscli-1.15.85 botocore-1.10.84 pyasn1-0.4.4 rsa-3.4.2 s3transfer-0.1.13 You are using pip version 10.0.1, however version 18.0 is available. You should consider upgrading via the 'pip install --upgrade pip' command. |
あれ、エラーが。
pipをアップグレードしなさいと。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
$ pip install --upgrade pip Collecting pip Downloading https://files.pythonhosted.org/packages/5f/25/e52d3f31441505a5f3af41213346e5b6c221c9e086a166f3703d2ddaf940/pip-18.0-py2.py3-none-any.whl (1.3MB) 100% |████████████████████████████████| 1.3MB 852kB/s docker 3.4.1 has requirement requests!=2.18.0,>=2.14.2, but you'll have requests 2.9.1 which is incompatible. Installing collected packages: pip Found existing installation: pip 10.0.1 Uninstalling pip-10.0.1: Successfully uninstalled pip-10.0.1 Rolling back uninstall of pip Could not install packages due to an EnvironmentError: [Errno 13] Permission denied: '/usr/local/lib/python3.5/dist-packages/pip-18.0.dist-info' Consider using the `--user` option or check the permissions. You are using pip version 10.0.1, however version 18.0 is available. You should consider upgrading via the 'pip install --upgrade pip' command. |
次はパーミッションですか。
sudoして。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
$ sudo pip install --upgrade pip The directory '/home/vagrant/.cache/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 '/home/vagrant/.cache/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 https://files.pythonhosted.org/packages/5f/25/e52d3f31441505a5f3af41213346e5b6c221c9e086a166f3703d2ddaf940/pip-18.0-py2.py3-none-any.whl (1.3MB) 100% |████████████████████████████████| 1.3MB 14.4MB/s docker 3.4.1 has requirement requests!=2.18.0,>=2.14.2, but you'll have requests 2.9.1 which is incompatible. Installing collected packages: pip Found existing installation: pip 10.0.1 Uninstalling pip-10.0.1: Successfully uninstalled pip-10.0.1 Successfully installed pip-18.0 |
無事入りました。
さて、AWS CLIのインストールに。
1 2 3 4 |
$ pip install awscli --upgrade --user -bash: /home/vagrant/.local/bin/pip: No such file or directory |
おや、そんなファイルがないと言われてしまった。
★ pip install --upgrade pipしたらNo such file or directoryになる
上記を参考にキャッシュの削除で。
1 2 3 |
$ hash -r |
こちらで再度インストールの実施。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
$ pip install awscli --upgrade --user Requirement already up-to-date: awscli in ./.local/lib/python3.5/site-packages (1.15.85) Requirement already satisfied, skipping upgrade: PyYAML<=3.13,>=3.10 in ./.local/lib/python3.5/site-packages (from awscli) (3.12) Requirement already satisfied, skipping upgrade: docutils>=0.10 in ./.local/lib/python3.5/site-packages (from awscli) (0.14) Requirement already satisfied, skipping upgrade: s3transfer<0.2.0,>=0.1.12 in ./.local/lib/python3.5/site-packages (from awscli) (0.1.13) Requirement already satisfied, skipping upgrade: colorama<=0.3.9,>=0.2.5 in ./.local/lib/python3.5/site-packages (from awscli) (0.3.9) Requirement already satisfied, skipping upgrade: rsa<=3.5.0,>=3.1.2 in ./.local/lib/python3.5/site-packages (from awscli) (3.4.2) Requirement already satisfied, skipping upgrade: botocore==1.10.84 in ./.local/lib/python3.5/site-packages (from awscli) (1.10.84) Requirement already satisfied, skipping upgrade: pyasn1>=0.1.3 in ./.local/lib/python3.5/site-packages (from rsa<=3.5.0,>=3.1.2->awscli) (0.4.4) Requirement already satisfied, skipping upgrade: jmespath<1.0.0,>=0.7.1 in ./.local/lib/python3.5/site-packages (from botocore==1.10.84->awscli) (0.9.3) Requirement already satisfied, skipping upgrade: python-dateutil<3.0.0,>=2.1; python_version >= "2.7" in ./.local/lib/python3.5/site-packages (from botocore==1.10.84->awscli) (2.7.3) Requirement already satisfied, skipping upgrade: six>=1.5 in ./.local/lib/python3.5/site-packages (from python-dateutil<3.0.0,>=2.1; python_version >= "2.7"->botocore==1.10.84->awscli) (1.11.0) |
無事入ったようで。
1 2 3 4 |
$ aws --version aws-cli/1.15.85 Python/3.5.2 Linux/4.4.0-116-generic botocore/1.10.84 |
version確認でも動きました。
このブログは株式会社CoLabMixによる技術ブログです。
GCP、AWSなどでのインフラ構築・運用や、クローリング・分析・検索などを主体とした開発を行なっています。
Ruby on RailsやDjango、Pythonなどの開発依頼などお気軽にお声がけください。
開発パートナーを増やしたいという企業と積極的に繋がっていきたいです。