11
10

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

OSX El Capitanでawscliのインストールに失敗する場合の対処方法

Last updated at Posted at 2016-02-02

OSX El Capitan (10.11.2)で、awscliをpip経由でインストールするのに失敗しました :disappointed_relieved:

インストール中のメッセージを抜粋するとこんな感じです。

Collecting six>=1.5 (from python-dateutil<3.0.0,>=2.1->botocore==1.3.23->awscli)
  Using cached six-1.10.0-py2.py3-none-any.whl
Installing collected packages: six, python-dateutil, docutils, botocore, pyasn1, rsa, colorama, awscli
  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):
:(略)
OSError: [Errno 1] Operation not permitted: '/tmp/pip-Pff7ay-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/six-1.4.1-py2.7.egg-info'

sixのver1.5以上が必要なんだけど、sixのver1.4.1がインストールされてたのを発見。でも、そのバージョンはdeprecatedだからuninstallするよって流れで、やっぱ無理だったーって感じだと思います。(たぶん)

sixは、python2系と3系の違いを吸収するユーティリティとのこと。
http://hhsprings.bitbucket.org/docs/translations/python/six-doc-ja/

すでに解決してた

いろんな人が困ってたみたいで、すでに解決されていました。
https://github.com/aws/aws-cli/issues/1522

インストールは**--ignore-installedオプションでsixを指定**してあげるだけでした :grinning:

$ sudo -H pip install awscli --upgrade --ignore-installed six

こんな感じでさくっとインストールが成功します。

Password:
Collecting awscli
  Using cached awscli-1.10.1-py2.py3-none-any.whl
Collecting six
  Using cached six-1.10.0-py2.py3-none-any.whl
Collecting botocore==1.3.23 (from awscli)
  Using cached botocore-1.3.23-py2.py3-none-any.whl
Collecting rsa<=3.3.0,>=3.1.2 (from awscli)
  Using cached rsa-3.3-py2.py3-none-any.whl
Collecting colorama<=0.3.3,>=0.2.5 (from awscli)
Collecting docutils>=0.10 (from awscli)
Collecting jmespath<1.0.0,>=0.7.1 (from botocore==1.3.23->awscli)
  Using cached jmespath-0.9.0-py2.py3-none-any.whl
Collecting python-dateutil<3.0.0,>=2.1 (from botocore==1.3.23->awscli)
  Using cached python_dateutil-2.4.2-py2.py3-none-any.whl
Collecting pyasn1>=0.1.3 (from rsa<=3.3.0,>=3.1.2->awscli)
  Using cached pyasn1-0.1.9-py2.py3-none-any.whl
Installing collected packages: jmespath, six, python-dateutil, docutils, botocore, pyasn1, rsa, colorama, awscli
Successfully installed awscli-1.10.1 botocore-1.3.23 colorama-0.3.3 docutils-0.12 jmespath-0.9.0 pyasn1-0.1.9 python-dateutil-1.5 rsa-3.3 six-1.4.1

最後に、インストールされているか確認します。

$ aws --version
aws-cli/1.10.1 Python/2.7.10 Darwin/15.2.0 botocore/1.3.23

先人の知恵はありがたいです :octocat:

追記

awscliは、brewでさくっとインストールできることを教えていだきました。こっちのほうがお手軽かもしれませんね。

$ brew install awscli

[参考]
http://docs.aws.amazon.com/ja_jp/cli/latest/userguide/installing.html
https://github.com/pypa/pip/issues/3165
https://github.com/aws/aws-cli/issues/1522

11
10
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
11
10

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?