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

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

Unicode Default Encoding

  1. The Unicode implementation has to make some assumption about the
  2. encoding of 8-bit strings passed to it for coercion and about the
  3. encoding to as default for conversion of Unicode to strings when
  4. no specific encoding is given. This encoding is called <default
  5. encoding> throughout this text.
  6.  
  7. For this, the implementation maintains a global which can be set
  8. in the site.py Python startup script. Subsequent changes are not
  9. possible. The <default encoding> can be set and queried using the
  10. two sys module APIs:
  11.  
  12. sys.setdefaultencoding(encoding)
  13. --> Sets the <default encoding> used by the Unicode implementation.
  14. encoding has to be an encoding which is supported by the
  15. Python installation, otherwise, a LookupError is raised.
  16.  
  17. Note: This API is only available in site.py! It is
  18. removed from the sys module by site.py after usage.
  19.  
  20. sys.getdefaultencoding()
  21. --> Returns the current <default encoding>.
  22.  
  23. If not otherwise defined or set, the <default encoding> defaults
  24. to 'ascii'. This encoding is also the startup default of Python
  25. (and in effect before site.py is executed).
  26.  
  27. Note that the default site.py startup module contains disabled
  28. optional code which can set the <default encoding> according to
  29. the encoding defined by the current locale. The locale module is
  30. used to extract the encoding from the locale default settings
  31. defined by the OS environment (see locale.py). If the encoding
  32. cannot be determined, is unknown or unsupported, the code defaults
  33. to setting the <default encoding> to 'ascii'. To enable this
  34. code, edit the site.py file or place the appropriate code into the
  35. 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. Amazon SES SPF和DKIM设置教程

    SPF和DKIM设置是争对域名邮箱而言的(公共邮件也不会给你修改DNS的权限),主要作用就是防止邮箱伪造提升邮件信用度 首先到亚马逊添加域名并验证 添加后,给出了域名验证的方法,就是在dns记录里添加 ...

  2. C#在splitContainer1控件和panel控件中显示窗体

    现在有两个窗体 Form1 和Form2 Form1中有控件splitContainer1 和panel .控件.我们希望Form2在splitContainer1或者panel控件中显示 1:首先看 ...

  3. PTA 团体程序设计天梯赛 L3-020 至多删三个字符

    $f[i][j]$表示到第$i$个字符,已经删去了$j$个字符的方案数. 显然的转移: $f[i][j] = f[i - 1][j] + f[i - 1][j - 1]$ 但是这样会有重复,我们考虑什 ...

  4. python性能分析(一)——使用timeit给你的程序打个表吧

    前言 我们可以通过查看程序核心算法的代码,得知核心算法的渐进上界或者下界,从而大概估计出程序在运行时的效率,但是这并不够直观,也不一定十分靠谱(在整体程序中仍有一些不可忽略的运行细节在估计时被忽略了) ...

  5. Java基础语法(基本语句)

    Java基础语法 标识符在程序中自定义的一些名称.由26个英文字母大小写,数字:0-9符号:_&组成定义合法标识符规则:1.      数字不可以开头2.      不可以使用关键字Java中 ...

  6. 把kafka数据从hbase迁移到hdfs,并按天加载到hive表(hbase与hadoop为不同集群)

    需求:由于我们用的阿里云Hbase,按存储收费,现在需要把kafka的数据直接同步到自己搭建的hadoop集群上,(kafka和hadoop集群在同一个局域网),然后对接到hive表中去,表按每天做分 ...

  7. 制作系统U盘,不用做任何动作直接从U盘启动装系统(非PE的)

    用U盘装系统可以用PE方式,进入PE系统,选择镜像文件,然后装,这种比较麻烦. 下面介绍一下从U盘启动,直接装系统的方法,这种方法从U盘启动后,不用做任何动作,就像用光盘装系统一样简单 首先要制作一下 ...

  8. 如何用tomcat发布自己的Java项目

    如何用tomcat发布自己的Java项目 tomcat是什么?它是一个免费的开放源代码的Web 应用服务器,属于轻量级应用服务器.我们用Java开发出来的web项目,通过tomcat发布出来,别人就可 ...

  9. Hive-复制表

    非分区表复制 复制一张非分区表,使用CREATE TABLE IF NOT EXISTS AS SELECT * FROM tb_name;只复制表结构,CREATE TABLE IF NOT EXI ...

  10. 编译安装vsftpd-3.0.2

    编译安装vsftpd 首先下载源码包(我一般喜欢放在/home/test) 解压:tar -zxvf vsftpd-3.0.2.tar.gz 进入目录进行编译 cd vsftpd-3.0.2 编译之前 ...