Anaconda3工具包中Python常用配置及报错解决办法

pip 工具的安装
下载pip工具包,解压后执行

python setup.py install
conda install pip

安装 pip包 thrift 报错
错误信息:
摘取如下

Traceback (most recent call last):
  File "d:\ProgramData\Anaconda3\lib\site-packages\pip\compat\__init__.py", line 73, in console_to_str
    return s.decode(sys.__stdout__.encoding)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xa1 in position 95: invalid start byte

During handling of the above exception, another exception occurred:


解决办法:
修改73行代码: 
注意报错的是 line 73

if sys.version_info >= (3,):
    def console_to_str(s):
        try:
            return s.decode(sys.__stdout__.encoding)
        except UnicodeDecodeError:
            return s.decode('utf_8')

修改为:

if sys.version_info >= (3,):
    def console_to_str(s):
        try:
            return s.decode('cp936')
        except UnicodeDecodeError:
            return s.decode('utf_8')

原文:https://blog.csdn.net/gzy11/article/details/78784274 
 

你可能感兴趣的:(Anaconda3工具包中Python常用配置及报错解决办法)