mac安装pip

1.下载get-pip.py

curl -O https://raw.github.com/pypa/pip/master/contrib/get-pip.py

SaintKings-Mac-mini:~ saintking$ curl -O https://bootstrap.pypa.io/get-pip.py

2.采取get-pip.py官方安装

➜  python vim ~/.bash_profile

编辑如下内容:

if [ -d $HOME/Library/Python/2.7/bin ]; then
    export PATH=$HOME/Library/Python/2.7/bin:$PATH
fi

然后别忘记source .bash_profile

第四步:配置pip参数:

➜  python cd ~

➜  ~ mkdir -p .pip

➜  ~ cd .pip

➜  .pip touch pip.conf

➜  .pip vim pip.conf

写入如下内容:

[global] default-timeout = 60

download-cache = ~/.pip/cache

log-file = ~/.pip/pip.log

[install] index-url = https://pypi.douban.com/simple

 

最后成功安装pip.

posted @ 2017-10-30 15:44  小码哥0520  阅读(724)  评论(0编辑  收藏  举报