Python在window环境中通过pip安装pandas报标题这样的错,主要是因为python默认编码格式是:ascii

在https://www.python.org/dev/peps/pep-0100/文章中有如下介绍

Unicode Default Encoding

    The Unicode implementation has to make some assumption about the
encoding of 8-bit strings passed to it for coercion and about the
encoding to as default for conversion of Unicode to strings when
no specific encoding is given. This encoding is called <default
encoding> throughout this text. For this, the implementation maintains a global which can be set
in the site.py Python startup script. Subsequent changes are not
possible. The <default encoding> can be set and queried using the
two sys module APIs: sys.setdefaultencoding(encoding)
--> Sets the <default encoding> used by the Unicode implementation.
encoding has to be an encoding which is supported by the
Python installation, otherwise, a LookupError is raised. Note: This API is only available in site.py! It is
removed from the sys module by site.py after usage. sys.getdefaultencoding()
--> Returns the current <default encoding>. If not otherwise defined or set, the <default encoding> defaults
to 'ascii'. This encoding is also the startup default of Python
(and in effect before site.py is executed). Note that the default site.py startup module contains disabled
optional code which can set the <default encoding> according to
the encoding defined by the current locale. The locale module is
used to extract the encoding from the locale default settings
defined by the OS environment (see locale.py). If the encoding
cannot be determined, is unknown or unsupported, the code defaults
to setting the <default encoding> to 'ascii'. To enable this
code, edit the site.py file or place the appropriate code into the
sitecustomize.py module of your Python installation.

解决方法:在python/lib/site.py中加入

import sys
reload(sys)
sys.setdefaultencoding('gbk')

问题就解决了。。。。。。。。。。。。

pip 安装pandas报UnicodeDecodeError: 'ascii' codec can't decode byte 0xd5错的更多相关文章

  1. Windows下面安装easy_install报UnicodeDecodeError: 'ascii' codec can't decode byte解决方法

    在运行python ez_setup.py install后, 发现是在下载并解压setuptools-2.1,并运行setup.py时出现如下错误: 提示D:\Python27\lib\mimety ...

  2. python 3以上版本使用pickle.load读取文件报UnicodeDecodeError: 'ascii' codec can't decode byte 0x8b in position 6

    python 3以上版本使用pickle.load读取文件报UnicodeDecodeError: 'ascii' codec can't decode byte 0x8b in position 6 ...

  3. Windows下使用pip安装python包是报错-UnicodeDecodeError: 'ascii' codec can't decode byte 0xcb in position 0

    先交待下开发环境: 操作系统:Windows 7 Python版本:2.7.9 Pip版本:6.1.1 其他环境忽略 在windows下使用pip下载python包,出现如下错误 Collecting ...

  4. 安装mysql-python报错:UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 65: ordinal not in range(128)

    安装mysql-python报错: UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 65: ordinal n ...

  5. setuptools,pip,install,UnicodeDecodeError: 'ascii' codec can't decode byte.原因和解决方案

    昨天重装Python2.7.6时,为了安装第三方库,我去下pip.为了装pip,又得先装 ez_setup.py.结果装ez_setup时,遇到了问题,报错: UnicodeDecodeError:  ...

  6. python2.7安装第三方库错误:UnicodeDecodeError: 'ascii' codec can't decode byte 0xcb in position 0

    开发环境:win10, x64, pycharm社区版,python2.7.13 python2经常会遇见乱码的问题,并且一遇到中文就乱码.所以我们在安装的时候要注意,无论是解释器interpreto ...

  7. saltstack--关于报错“UnicodeDecodeError: 'ascii' codec can't decode byte 0xe6 in position 6: ordinal not in range(128)”

    [root@linux-node1 桌面]# salt-key [ERROR ] 'ascii' codec can't decode byte 0xe6 in position 6: ordinal ...

  8. python2.7 报错(UnicodeDecodeError: 'ascii' codec can't decode byte 0xe6 in position 0: ordinal not in range(128))

    报错: 原来用的python3.5版本后来改为2.7出现了这个错误里面的中文无法显示 UnicodeDecodeError: 'ascii' codec can't decode byte 0xe6 ...

  9. django startproject xxx:报错UnicodeDecodeError: 'ascii' codec can't decode byte 0xe6 in position 13: ordinal not in range(128)

    django startproject xxx:报错UnicodeDecodeError: 'ascii' codec can't decode byte 0xe6 in position 13: o ...

随机推荐

  1. 【设置】Nginx配置文件具体配置解释

    #定义Nginx运行的用户和用户组 user www www; #nginx进程数,建议设置为等于CPU总核心数. worker_processes 8; #全局错误日志定义类型,[ debug | ...

  2. 教你玩转产品管理系统iClap(PC端功能篇)

    之前和大家介绍了iClap的基础功能, 这一次针对PC端右侧的工具栏再做一个详细的介绍 随着版本的更新迭代,陆续会有更多工具和功能推出! 导航 为项目成员提供网址浏览访问导航服务,帮助项目成员快速查找 ...

  3. lnmp1.4 安装php fileinfo扩展 方法

    第一步:在lnmp1.4找到php安装的版本 使用命令 tar   -jxvf   php-7.1.7.tar.bz2 解压 第二步: 在解压的php-7.1.7文件夹里找到fileinfo文件夹,然 ...

  4. Masonry 适配label多行

    设置属性后,然后根据文本自动多行显示,无需设置标签高度约束 1 属性preferredMaxLayoutWidth,如:label.preferredMaxLayoutWidth = (WidthSc ...

  5. vim 常用命令小结

    1.打开多个窗口 split   上下打开窗口 vsplit     左右开打窗口 ctrl + ww  窗口之间切换 ctrl + wq  退出当前窗口 2.移动光标:     数字 0 : 将光标 ...

  6. jquery easyUI中combobox的使用总结

    jquery easyUI中combobox的使用总结 一.如何让jquery-easyui的combobox像select那样不可编辑?为combobox添加editable属性 设置为false ...

  7. [省选模拟]Rhyme

    考的时候脑子各种短路,用个SAM瞎搞了半天没搞出来,最后中午火急火燎的打了个SPFA才混了点分. 其实这个可以把每个模式串长度为$K-1$的字符串看作一个状态,这个用字符串Hash实现,然后我们发现这 ...

  8. Fast特征点的寻找和提取

    一.基础 最初由Rosten和Drummond [Rosten06]提出的FAST(加速段测试的特征)特征检测算法是基于将点P与其包围圆内的点集的直接比较的思想. 基本思想是,如果附近的几个点与P类似 ...

  9. 20145306 网路攻防 web安全基础实践

    20145306 网络攻防 web安全基础实践 实验内容 使用webgoat进行XSS攻击.CSRF攻击.SQL注入 XSS攻击:Stored XSS Attacks.Reflected XSS At ...

  10. TF-调整矩阵维度 tf.reshape 介绍

    函数原型为 def reshape(tensor, shape, name=None) 第1个参数为被调整维度的张量. 第2个参数为要调整为的形状. 返回一个shape形状的新tensor 注意sha ...