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')

你可能感兴趣的:(配置,报错,Python,常用配置)