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

macで pip 更新エラーについて

More than 1 year has passed since last update.

この記事はWanoアドベントカレンダーの21日目の記事です。

ある日、install pythonのlib時
あるmessage出てました

You are using pip version 8.1.2, however version 18.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

OK、普通の更新と思いますから
指示通り、以下の命令入れた:

~ pip install --upgrade pip

Exception:
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/site-packages/pip/basecommand.py", line 215, in main
  File "/usr/local/lib/python2.7/site-packages/pip/commands/install.py", line 342, in run
  File "/usr/local/lib/python2.7/site-packages/pip/req/req_set.py", line 784, in install
  File "/usr/local/lib/python2.7/site-packages/pip/req/req_install.py", line 851, in install
  File "/usr/local/lib/python2.7/site-packages/pip/req/req_install.py", line 1064, in move_wheel_files
  File "/usr/local/lib/python2.7/site-packages/pip/wheel.py", line 462, in move_wheel_files
  File "/usr/local/lib/python2.7/site-packages/pip/_vendor/distlib/scripts.py", line 372, in make

  File "/usr/local/lib/python2.7/site-packages/pip/_vendor/distlib/scripts.py", line 276, in _make_script
    if self._is_nt and not outname.endswith('.' + ext):  # pragma: no cover
  File "/usr/local/lib/python2.7/site-packages/pip/_vendor/distlib/scripts.py", line 250, in _write_script
    script_bytes = launcher + shebang + linesep + zip_data
  File "/usr/local/lib/python2.7/site-packages/pip/_vendor/distlib/util.py", line 407, in write_binary_file

IOError: [Errno 13] Permission denied: '/usr/local/bin/pip'

権限足りない?ならば

~ sudo pip install --upgrade pip

Traceback (most recent call last):
  File "/usr/local/bin/pip", line 11, in <module>
    load_entry_point('pip==9.0.1', 'console_scripts', 'pip')()
  File "/Users/johnny/Library/Python/2.7/lib/python/site-packages/pkg_resources/__init__.py", line 567, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/Users/johnny/Library/Python/2.7/lib/python/site-packages/pkg_resources/__init__.py", line 2604, in load_entry_point
    return ep.load()
  File "/Users/johnny/Library/Python/2.7/lib/python/site-packages/pkg_resources/__init__.py", line 2264, in load
    return self.resolve()
  File "/Users/johnny/Library/Python/2.7/lib/python/site-packages/pkg_resources/__init__.py", line 2274, in resolve
    raise ImportError(str(exc))
ImportError: 'module' object has no attribute 'main'

調べると、何がversionの問題っぽい
pip install --upgrade pip (10.0.0) 後の奇妙な挙動について

この時点既にpip動くできないので、取りあえず一旦10.0.0のversion前戻す
sudo python -m pip install pip==9.0.1

もしpip10に乗り換えたいなら、既存のパッケージに影響の可能性があるので、注意してください

wano-inc
「Cultivate your dream」をミッションにクリエイター・アーティストを支援する事業やサービスを展開
https://wano.co.jp/
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
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  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
ユーザーは見つかりませんでした