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 ...
随机推荐
- 菜刀php过waf
关于PHP 一.waf为啥会拦截菜刀.菜刀在连接时,会向server端POST数据,抓包查看: 会看到他向server端post了 @eval(base64_decode($_POST[z0])); ...
- js实现网页tab选项卡切换效果
<style> *{margin:0;padding:0;} body{font-size:14px;font-family:"Microsoft YaHei";} u ...
- Summary: Java中函数参数的传递
函数调用参数传递类型(java)的用法介绍. java方法中传值和传引用的问题是个基本问题,但是也有很多人一时弄不清. (一)基本数据类型:传值,方法不会改变实参的值. public class Te ...
- AHB-Lite简介
AHB总线实现了简单的基于burst的传输,数据总线带宽可配置32-1024bit.可以实现简单的fixed pipeline在address/control phase和 data phase之间. ...
- ARM的Trust Zone技术
ARM的Trust_Zone技术是一个系统的Access Control的架构. 与AXI,AHB,APB其中的secure,supervisor信号相关联. 与ARM core的模式相关连,当ARM ...
- JSON草稿
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.T ...
- VS相关设置
1.显示行号 工具-〉选项-〉文本编辑器-〉语言(比如C#)-〉显示-〉行号 2.“解决方案资源管理器”被拖出来了,无法还原 两种方法:1.窗口-->重置窗口布局2.工具-->导入和导出设 ...
- python 展开嵌套的序列
将一个多层嵌套的序列展开成一个单层列表 可以写一个包含yield from 语句的递归生成器来轻松解决这个问题. from collections import Iterable def flatte ...
- Python: 字典列表: itemgetter 函数: 根据某个或某几个字典字段来排序列表
问题:根据某个或某几个字典字段来排序Python列表 answer: 通过使用operator 模块的itemgetter 函数,可以非常容易的排序这样的数据结构 eg: rows = [ {'fna ...
- Linux基础命令---znew
znew 将compress压缩成的”.Z”文件,转换成“.gz”格式的文件.ZNew将文件从.z(压缩)格式重新压缩到.gz(Gzip)格式.如果要重新压缩已以gzip格式的文件,请重命名该文件以强 ...