6
0

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.

Dockerでエラーが出たので解消した(ERROR: Dependency conflict: an older version of the 'docker-py' package is polluting the namespace.)

Last updated at Posted at 2017-03-16

環境

macOS Sierra
Version 10.12.3

Docker
Community Edition
Version 17.03.0-ce-mac2
Channel: stable

エラー内容

ある日突然、Dockerを起動しようとしたら下記のエラーが発生

$ docker-compose up
ERROR: Dependency conflict: an older version of the 'docker-py' package is polluting the namespace. Run the following command to remedy the issue:
pip uninstall docker docker-py; pip install docker

言われたとおりにやってみても治らない(T_T)

pip uninstall docker docker-py; pip install docker

原因

最近はAWS Elastic Beanstalkを使うことが多いのですが、そのクライアントであるawsebcliで使ってるライブラリのVersionの相性がよくないよう
https://github.com/docker/compose/issues/4569#issuecomment-284891018

解消方法

virtualenvを使って仮想環境に EB CLI をインストールすることで回避
http://docs.aws.amazon.com/ja_jp/elasticbeanstalk/latest/dg/eb-cli3-install-virtualenv.html
ページの内容の通りにインストール

ebを使うときには仮想環境をアクティブ化します

$ source ~/eb-ve/bin/activate

再度Docker起動

$ docker-compose up
ERROR: Dependency conflict: an older version of the 'docker-py' package is polluting the namespace. Run the following command to remedy the issue:
pip uninstall docker docker-py; pip install docker

以下を実行

pip uninstall docker docker-py; pip install docker

※~/eb-ve/bin/activateにパスが通ってない状態で

動作確認

dockerが起動できるようになってると思います。

ebも確認

$ eb ssh
INFO: Attempting to open port 22.
INFO: SSH port 22 open.
..
 _____ _           _   _      ____                       _        _ _
| ____| | __ _ ___| |_(_) ___| __ )  ___  __ _ _ __  ___| |_ __ _| | | __
|  _| | |/ _` / __| __| |/ __|  _ \ / _ \/ _` | '_ \/ __| __/ _` | | |/ /
| |___| | (_| \__ \ |_| | (__| |_) |  __/ (_| | | | \__ \ || (_| | |   <
|_____|_|\__,_|___/\__|_|\___|____/ \___|\__,_|_| |_|___/\__\__,_|_|_|\_\
                                       Amazon Linux AMI

ssh、deployできればおk

6
0
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
6
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?