Mac 安装 pip

Mac 安装 python3

brew install python3

报错:

curl: (22) The requested URL returned error: 404 Not Found
Error: Failed to download resource "readline--patch"
Download failed: https://gist.githubusercontent.com/jacknagel/d886531fb6623b60b2af/raw/746fc543e56bc37a26ccf05d2946a45176b0894e/readline-6.3.8.diff

StackFlow上找到原因,brew版本太老了,
需要更新brew, 而简单的brew update 或者sudo update 是不行的,拷贝这个

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

等待完成之后重新

brew install python3 

下面是Pip安装:

简单:

sudo easy_install pip

使用pip安装插件 pip install 遇到如下问题

先 5次Retry...
然后 raise ProxyError 403

解决步骤

1. 删除自定义proxy

当时在终端配置了鱼摆摆的代理,然后鱼摆摆挂了一直也没处理这个代理。

cd ~/ && ls -a

删除以下配置中的指定http_proxy:

  1. bashrc
  2. bash_profile
  3. bash_profile-anaconda.bak 如果有的话
  4. bash_profile.pysave

2. 指定国内镜像源

mkdir .pip
cd .pip
vim pip.conf

粘贴如下配置:

[global]
index-url = https://pypi.tuna.tsinghua.edu.cn/simple
[install]
trusted-host=mirrors.aliyun.com

打完收工

你可能感兴趣的:(Mac 安装 pip)