pip 安装pandas报UnicodeDecodeError: 'ascii' codec can't decode byte 0xd5错
当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错的更多相关文章
- Windows下面安装easy_install报UnicodeDecodeError: 'ascii' codec can't decode byte解决方法
在运行python ez_setup.py install后, 发现是在下载并解压setuptools-2.1,并运行setup.py时出现如下错误: 提示D:\Python27\lib\mimety ...
- 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 ...
- 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 ...
- 安装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 ...
- setuptools,pip,install,UnicodeDecodeError: 'ascii' codec can't decode byte.原因和解决方案
昨天重装Python2.7.6时,为了安装第三方库,我去下pip.为了装pip,又得先装 ez_setup.py.结果装ez_setup时,遇到了问题,报错: UnicodeDecodeError: ...
- python2.7安装第三方库错误:UnicodeDecodeError: 'ascii' codec can't decode byte 0xcb in position 0
开发环境:win10, x64, pycharm社区版,python2.7.13 python2经常会遇见乱码的问题,并且一遇到中文就乱码.所以我们在安装的时候要注意,无论是解释器interpreto ...
- 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 ...
- 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 ...
- 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 ...
随机推荐
- notification 是同步的
所有notification的观察者执行之后,post notification的函数才会往下执行.
- sqlplus与shell互相传值的几种情况
2578人阅读 sqlplus与shell互相传值的几种情况 情况一:在shell中最简单的调用sqlplus $cat test.sh #!/bin/sh sqlplus oracle/orac ...
- numpy.random.rand()/randn()/randint()/normal()/choice()/RandomState()
这玩意用了很多次,但每次用还是容易混淆,今天来总结mark一下~~~ 1. numpy.random.rand(d0,d1,...,dn) 生成一个[0,1)之间的随机数或N维数组 np.random ...
- C#可扩展数组转变为String[]数组
简单备忘: 由于需要将数据最终以逗号隔开来拼接,因而写了下面的处理方法. public void GetJoinString() { ArrayList arr = new ArrayList(); ...
- 批量导入数据到mssql数据库的
概述 批量导入数据到数据库中,我们有好几种方式. 从一个数据表里生成数据脚本,到另一个数据库里执行脚本 从EXCEL里导入数据 上面两种方式,导入的数据都会生成大量的日志.如果批量导入5W条数据到数据 ...
- Leetcode: Repeated DNA Sequence
All DNA is composed of a series of nucleotides abbreviated as A, C, G, and T, for example: "ACG ...
- BootStrap的布局学习
布局组件无数可复用的组件,包括字体图标.下拉菜单.导航.警告框.弹出框等更多功能. Bootstrap的使用非常灵活,可以对各种组件进行合并使用(如:为标签页项 添加带下拉菜单),下面的知识点中将逐个 ...
- Java Nested Classes(内部类~第一篇英文技术文档翻译)
鄙人最近尝试着翻译了自己的第一篇英文技术文档.Java Nested Classes Reference From Oracle Documentation 目录 嵌套类-Nested Classes ...
- Python入门之Pycharm开发中最常用快捷键
要查阅Pycharm的快捷键,当然要看官方文档,https://www.jetbrains.com/help/pycharm/mastering-keyboard-shortcuts.html 编辑类 ...
- HTML5交互性图表库
官网链接:https://www.hcharts.cn/ 出品公司链接:https://jianshukeji.com/ Highcharts Highstock highmaps