anaconda win10安装报错:UnicodeDecodeError解决方法

Traceback (most recent call last):
File "D:\Anaconda2\Scripts\conda-script.py", line , in <module>
import conda.cli
File "D:\Anaconda2\lib\site-packages\conda\cli\__init__.py", line , in <module>
from .main import main # NOQA
File "D:\Anaconda2\lib\site-packages\conda\cli\main.py", line , in <module>
from ..base.context import context
File "D:\Anaconda2\lib\site-packages\conda\base\context.py", line , in <module>
context = Context(SEARCH_PATH, conda, None)
File "D:\Anaconda2\lib\site-packages\conda\common\configuration.py", line , in __init__
self._add_search_path(search_path)
File "D:\Anaconda2\lib\site-packages\conda\common\configuration.py", line , in _add_search_path
return self._add_raw_data(load_file_configs(search_path))
File "D:\Anaconda2\lib\site-packages\conda\common\configuration.py", line , in load_file_configs
raw_data = odict(kv for kv in chain.from_iterable(load_paths))
File "D:\Anaconda2\lib\collections.py", line , in __init__
self.__update(*args, **kwds)
File "D:\Anaconda2\lib\_abcoll.py", line , in update
for key, value in other:
File "D:\Anaconda2\lib\site-packages\conda\common\configuration.py", line , in <genexpr>
raw_data = odict(kv for kv in chain.from_iterable(load_paths))
File "D:\Anaconda2\lib\site-packages\conda\common\configuration.py", line , in _file_yaml_loader
assert fullpath.endswith(".yml") or fullpath.endswith("condarc"), fullpath
UnicodeDecodeError: 'utf8' codec can't decode byte 0xce in position 11: invalid continuation byte

今天安装anaconda之后提示这种错误,然后在网上找到的方法都不管问题

http://www.cnblogs.com/harrychinese/archive/2012/01/19/change_python_default_encoding.html

而他的方法用了之后还是gg,于是继续找,最终

http://blog.csdn.net/hugleecool/article/details/17996993

把sitecustomize.py改成上面网站的代码,最终搞定。

即:增加一个名为 sitecustomize.py, 推荐存放的路径为 site-packages 目录下
sitecustomize.py 是在 site.py 被import 执行的, 因为 sys.setdefaultencoding() 是在 site.py 的结尾处被删除的, 所以, 可以在 sitecustomize.py 使用 sys.setdefaultencoding(). 
#file name:  sitecustomize.py

import sys
sys.setdefaultencoding('gbk')
上一篇:No Dialect mapping for JDBC type: -9


下一篇:python3.5学习第一章