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

pipのインストールにハマって悲しい思いをしているたぶんEl Capitanなあなたへ

More than 3 years have passed since last update.

いつの間にかpipのインストールが楽になってた件

python get-pip.py
これを入れても

Collecting pip
  Using cached pip-8.1.1-py2.py3-none-any.whl
Collecting wheel
  Using cached wheel-0.29.0-py2.py3-none-any.whl
Installing collected packages: pip, wheel
Exception:
Traceback (most recent call last):
  File "/var/folders/1s/zx_tbsz12q11ff8h79g8yqy40000gn/T/tmpXAEHyo/pip.zip/pip/basecommand.py", line 209, in main
    status = self.run(options, args)
  File "/var/folders/1s/zx_tbsz12q11ff8h79g8yqy40000gn/T/tmpXAEHyo/pip.zip/pip/commands/install.py", line 317, in run
    prefix=options.prefix_path,
  File "/var/folders/1s/zx_tbsz12q11ff8h79g8yqy40000gn/T/tmpXAEHyo/pip.zip/pip/req/req_set.py", line 732, in install
    **kwargs
  File "/var/folders/1s/zx_tbsz12q11ff8h79g8yqy40000gn/T/tmpXAEHyo/pip.zip/pip/req/req_install.py", line 835, in install
    self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
  File "/var/folders/1s/zx_tbsz12q11ff8h79g8yqy40000gn/T/tmpXAEHyo/pip.zip/pip/req/req_install.py", line 1030, in move_wheel_files
    isolated=self.isolated,
  File "/var/folders/1s/zx_tbsz12q11ff8h79g8yqy40000gn/T/tmpXAEHyo/pip.zip/pip/wheel.py", line 344, in move_wheel_files
    clobber(source, lib_dir, True)
  File "/var/folders/1s/zx_tbsz12q11ff8h79g8yqy40000gn/T/tmpXAEHyo/pip.zip/pip/wheel.py", line 315, in clobber
    ensure_dir(destdir)
  File "/var/folders/1s/zx_tbsz12q11ff8h79g8yqy40000gn/T/tmpXAEHyo/pip.zip/pip/utils/__init__.py", line 83, in ensure_dir
    os.makedirs(path)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 157, in makedirs
    mkdir(name, mode)
OSError: [Errno 13] Permission denied: '/Library/Python/2.7/site-packages/pip'

こういうの出がちですよね。

そこでこういうの入れても

curl -kL https://raw.github.com/pypa/pip/master/contrib/get-pip.py | python

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:--  0:00:01 --:--:--     0
100   260  100   260    0     0     95      0  0:00:02  0:00:02 --:--:--     0
You're using an outdated location for the get-pip.py script, please use the one available from https://bootstrap.pypa.io/get-pip.py

時代遅れだよ、などと言われてしまいます。

↓たぶんこの1行で解決です。
curl -kL https://bootstrap.pypa.io/get-pip.py | sudo python

get-pip.pyの場所が変わってるみたいですね。
なんか「このディレクトリはあんたの権限じゃないよ」とか言われてもsudoすれば通ります。

(追記)
※どうもEl Capitanになってpipのインストールがハマりやすくなっているっぽいです。sudoしても通らないことがしばしばある様子。

http://stackoverflow.com/questions/32898583/unable-to-install-nltk-on-mac-os-el-capitan

あとそもそもPythonは3.5とかも出てるけど2.7のほうが無難っぽい。

pipは普通に入れると管理者権限から外れてしまって結構厄介なようなので、管理者権限の中に入るようにダウンロード場所を工夫するのが吉のよう。
http://hacknote.jp/archives/19074/

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
ユーザーは見つかりませんでした