awsebcliインストール時に”DEPRECATION: Uninstalling a distutils installed project (pyyaml) has been deprecated”


 


Elastic BeanstalkのCLI管理ツールであるawsebcliだが、インストールすべく公式ページのコマンドを頭から実行していくと、若干つまづく。

https://docs.aws.amazon.com/ja_jp/elasticbeanstalk/latest/dg/eb-cli3-install.html

pip install awsebcli

を実行すると、


Found existing installation: PyYAML 3.10
DEPRECATION: Uninstalling a distutils installed project (pyyaml) 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 PyYAML-3.10:
Exception:
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/pip/basecommand.py", line 246, in main
status = self.run(options, args)
File "/usr/lib/python2.7/dist-packages/pip/commands/install.py", line 352, in run
root=options.root_path,
File "/usr/lib/python2.7/dist-packages/pip/req/req_set.py", line 687, in install
requirement.uninstall(auto_confirm=True)
File "/usr/lib/python2.7/dist-packages/pip/req/req_install.py", line 730, in uninstall
paths_to_remove.remove(auto_confirm)
File "/usr/lib/python2.7/dist-packages/pip/req/req_uninstall.py", line 126, in remove
renames(path, new_path)
File "/usr/lib/python2.7/dist-packages/pip/utils/__init__.py", line 292, in renames
shutil.move(old, new)
File "/usr/lib64/python2.7/shutil.py", line 303, in move
os.unlink(src)
OSError: [Errno 13] Permission denied: '/usr/lib64/python2.7/dist-packages/PyYAML-3.10.egg-info'

となり、awsebcliがインストールできない。

上記のようなエラーが出た場合、pipの最新版のインストールから試せばよい。


curl -O https://bootstrap.pypa.io/get-pip.py

sudo python27 get-pip.py

sudo /usr/local/bin/pip install awsebcli

本来”sudo pip install awsebcli”でいいはずだが、公式ページにあるとおりパスが通ってないとフルパスでpipを指定することになる・・。


[ec2-user@ip-10-11-11-58 ~]$ eb --version
EB CLI 3.5.4 (Python 2.7.1)

 
うまくいった。

 

Amazon Web Services in Action
Amazon Web Services in Action

posted with amazlet at 15.10.24
Andreas Wittig Michael Wittig
Manning Pubns Co
売り上げランキング: 36,497

関連記事