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

Wanoグループ Advent Calendar 2018

Day 21

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

Last updated at Posted at 2018-12-20

この記事は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) 後の奇妙な挙動について] (http://icchy.hatenablog.jp/entry/2018/04/17/064443#solution)

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

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

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