AWS CLI バージョンアップでエラー発生を解消

AWS CLI バージョンアップでエラー発生を解消

$ pip install awscli --upgrade --user
:
OSError: [Errno 13] Permission denied: '/Users/hayshogo/Library/Python/2.7/lib'

pipのインストールでエラー

$ sudo easy_install pip
TEST FAILED: /lib/python2.7/site-packages/ does NOT support .pth files
error: bad install directory or PYTHONPATH
$ cat ~/.pydistutils.cfg 
[install]
prefix=

空のprefixを.pydistutils.cfgで定義したのでこれを除去

$ rm ~/.pydistutils.cfg                                       
$ sudo easy_install pip                                    
$ aws -v
:
ImportError: No module named colorama

HomeBrewでインストールしたPython削除

$ brew uninstall python

デフォルトでインストールされているPythonが使われていることを確認

PyenvでPythonをインストール

以下を追記

Pythonのバージョンをインストール

目的のPythonのバージョンに切り替え

通常は以下のようにアップグレード可能

参考

  • Permission denied: '/Library/Python/2.7/site-packages/pync/vendor' https://github.com/sindresorhus/weechat-notification-center/issues/1

  • Pythonインストール(Mac編) https://qiita.com/ms-rock/items/6e4498a5963f3d9c4a67

Last updated