pip 安装pandas报UnicodeDecodeError: 'ascii' codec can't decode byte 0xd5错

时间:2022-11-08 12:32:45

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&lowbar;install报UnicodeDecodeError&colon; 'ascii' codec can't decode byte解决方法

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

  2. python 3以上版本使用pickle&period;load读取文件报UnicodeDecodeError&colon; &&num;39&semi;ascii&&num;39&semi; codec can&&num;39&semi;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&colon; &&num;39&semi;ascii&&num;39&semi; codec can&&num;39&semi;t decode byte 0xcb in position 0

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

  4. 安装mysql-python报错&colon;UnicodeDecodeError&colon; &&num;39&semi;ascii&&num;39&semi; codec can&&num;39&semi;t decode byte 0xe2 in position 65&colon; ordinal not in range&lpar;128&rpar;

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

  5. setuptools&comma;pip&comma;install&comma;UnicodeDecodeError&colon; &&num;39&semi;ascii&&num;39&semi; codec can&&num;39&semi;t decode byte&period;原因和解决方案

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

  6. python2&period;7安装第三方库错误:UnicodeDecodeError&colon; &&num;39&semi;ascii&&num;39&semi; codec can&&num;39&semi;t decode byte 0xcb in position 0

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

  7. saltstack--关于报错&OpenCurlyDoubleQuote;UnicodeDecodeError&colon; &&num;39&semi;ascii&&num;39&semi; codec can&&num;39&semi;t decode byte 0xe6 in position 6&colon; ordinal not in range&lpar;128&rpar;”

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

  8. python2&period;7 报错(UnicodeDecodeError&colon; &&num;39&semi;ascii&&num;39&semi; codec can&&num;39&semi;t decode byte 0xe6 in position 0&colon; ordinal not in range&lpar;128&rpar;)

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

  9. django startproject xxx&colon;报错UnicodeDecodeError&colon; &&num;39&semi;ascii&&num;39&semi; codec can&&num;39&semi;t decode byte 0xe6 in position 13&colon; ordinal not in range&lpar;128&rpar;

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

随机推荐

  1. maven命令参考简要

    命令参考简要说明 mvn archetype:generate — 创建生成Tiny骨架工程 参数名 说明 groupId 用户项目的包目录,用户需要根据实际情况设置.比如com.abc artifa ...

  2. jQuery插件解析

    简单的插件demo //sample:扩展jquery对象的方法,bold()用于加粗字体. (function ($) { $.fn.extend({ "bold": funct ...

  3. Yii源码阅读笔记(八)

    前面阅读了Yii2的两个基本类Object和Component,了解了Yii的三个重要概念属性.事件.行为,下面开始阅读Event类,Event类是所有事件类的基类: <?php /** * @ ...

  4. loadrunner具体实例教你如何进行结果分析

    1.对于吞吐量,单位时间内吞吐量越大,说明服务器的处理能越好,而请求数仅表示客户端向服务器发出的请求数,与吞吐量一般是成正比关系. 2.一般瓶颈应该就是某个因素在不断增加,某个相关性能指标也会不断增加 ...

  5. thinking in java之Collections工具类的使用

    代码摘自<thinking in java>4td 此实例非常好的总结了Collections的一些常见方法的使用. package countainers; import java.ut ...

  6. 帝国CMS商城功能高级使用

    一.常见问题1.为什么自定义模型加入购物车提示“非商城表的信息”?答:模型要使用商城的功能,要先到:后台>商城>商城参数设置:“指定使用商肠能的数据表”勾选你这个自定义模型表,才可以使用. ...

  7. LSP&OpenCurlyDoubleQuote;浏览器劫持概念

    关于Winsock LSP“浏览器劫持”,中招者一直高居不下,由于其特殊性,直接删除而不恢复LSP的正常状态很可能会导致无法上网所以对其修复需慎重.   先说说什么是Winsock LSP“浏览器劫持 ...

  8. linux 提高进程优先级nice&plus; 进程调度CFS

    http://www.cnblogs.com/wang_yb/archive/2012/09/04/2670564.htmlhttp://liwei.life/2016/04/07/linux%E7% ...

  9. &period;net momeryStream 读取为空问题

    问题 stream读取错误 我需要把用户上传的图片,加水印,然后保存到阿里云的oss.保存成功,但是保存的数据为空.唯一的异常 :ReadTimeout = “newPicStream.ReadTim ...

  10. (转)Linux 系统服务的启动顺序解析 rc&period;&ast;

    介绍系统按照不同级别启动时需要启动的服务. 进入目录:etc 执行命令:ls -l | grep "rc.*" | sort 结果如下图:   1 系统在启动时,通过inittab ...