pip是常用的python包管理工具,类似于java的maven。用python的同学,都离不开pip。
在新mac中想用home-brew安装pip时,遇到了一些小问题:bogon:~ Mac$ brew install pip
Error: No available formula with the name "pip"
Homebrew provides pip via: `brew install python`. However you will then
have two Pythons installed on your Mac, so alternatively you can install
pip via the instructions at:
https://pip.readthedocs.org/en/stable/installing/#install-pip
由此可见,在home-brew中,pip的安装是跟python一起的。
换种方式:
mac里面python自带easy_install的,最快的应该就是在terminal里面sudo easy_install pip了,网络好几秒就ok。运行完可以用pip help测试一下是否安装成功,成功安装后,直接pip install numpy或者其他包就可以了。
bogon:~ Mac$ sudo easy_install pip
Password:
Searching for pip
Reading https://pypi.python.org/simple/pip/
...
稍等片刻,pip就安装完毕。。。
ps:用sudo的时候需要输入密码,这个密码是你自己电脑的密码,输入的时候采取了“保密措施”,你看不到自己输入的字符,完整的输入进去以后,回车就可以了。