Help us understand the problem. What is going on with this article?

DistributionNotFoundエラーの対処方法

More than 5 years have passed since last update.

問題

pipのバージョンが古いため、正常に動作しなかった。

環境

OSX 10.9.2

トラブル

コマンド

$ python --version

実行結果

Traceback (most recent call last):
  File "/usr/local/bin/pip", line 5, in <module>
    from pkg_resources import load_entry_point
  File "/Library/Python/2.7/site-packages/distribute-0.6.49-py2.7.egg/pkg_resources.py", line 2877, in <module>
    working_set.require(__requires__)
  File "/Library/Python/2.7/site-packages/distribute-0.6.49-py2.7.egg/pkg_resources.py", line 698, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/Library/Python/2.7/site-packages/distribute-0.6.49-py2.7.egg/pkg_resources.py", line 596, in resolve
    raise DistributionNotFound(req)
pkg_resources.DistributionNotFound: pip==1.4.1

対応方法

pipをupgradeすることによって解決した。

コマンド

$ sudo easy_install --upgrade pip

実行結果

Reading http://pypi.python.org/simple/pip/
Best match: pip 1.5.4
Downloading https://pypi.python.org/packages/source/p/pip/pip-1.5.4.tar.gz#md5=834b2904f92d46aaa333267fb1c922bb
Processing pip-1.5.4.tar.gz
Writing /tmp/easy_install-w8dJ21/pip-1.5.4/setup.cfg
Running pip-1.5.4/setup.py -q bdist_egg --dist-dir /tmp/easy_install-w8dJ21/pip-1.5.4/egg-dist-tmp-61WflU
warning: no files found matching 'pip/cacert.pem'
warning: no files found matching '*.html' under directory 'docs'
warning: no previously-included files matching '*.rst' found under directory 'docs/_build'
no previously-included directories found matching 'docs/_build/_sources'
Adding pip 1.5.4 to easy-install.pth file
Installing pip script to /usr/local/bin
Installing pip2.7 script to /usr/local/bin
Installing pip2 script to /usr/local/bin

Installed /Library/Python/2.7/site-packages/pip-1.5.4-py2.7.egg
Processing dependencies for pip
Finished processing dependencies for pip

確認

正常に動作するようになったことを確認した。

コマンド

$ python --version

実行結果

pip 1.5.4 from /Library/Python/2.7/site-packages/pip-1.5.4-py2.7.egg (python 2.7)
saicologic
株式会社Voicyでエンジニアリングマネージャーをしています。
http://github.com/saicologic
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