pip无法安装 transport encoding

一、原因

原因是pip安装Python包会加载我的用户目录,我的用户目录恰好是中文的,ascii不能编码。

二、解决办法

  1. python目录 Python27\Lib\site-packages 建一个文件sitecustomize.py
  2. 内容
import sys 
sys.setdefaultencoding('gbk') 

三、针对anaconda

直接使用conda安装

#pip install numpy
conda install numpy

你可能感兴趣的:(pip无法安装 transport encoding)