Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
11
Help us understand the problem. What is going on with this article?
@szk3

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

More than 5 years have passed since last update.

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
Help us understand the problem. What is going on with this article?
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
szk3
My interests are AWS/GCP/VSCode/Node.js/TypeScript/golang/rust. My posts represent the views of the individual, not the official position of the organization.
lifull
日本最大級の不動産・住宅情報サイト「LIFULL HOME'S」を始め、人々の生活に寄り添う様々な情報サービス事業を展開しています。

Comments

No comments
Sign up for free and join this conversation.
Sign Up
If you already have a Qiita account Login
11
Help us understand the problem. What is going on with this article?