【问题标题】:`pip install pandas` gives UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 41: ordinal not in range(128)`pip install pandas` 给出 UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 41: ordinal not in range(128)
【发布时间】:2013-12-31 14:06:29
【问题描述】:

在 Digital Ocean 512MB 液滴上执行 pip install pandas 时,我收到错误 UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 41: ordinal not in range(128)

任何想法可能是什么原因造成的?我正在运行 Ubuntu 12.04 64 位。

[Full Error]

【问题讨论】:

  • 什么是完整回溯?
  • @Blender 刚刚添加到原帖中
  • 您的 VPS 上有多少 RAM? GCC 正在被操作系统杀死,这可能意味着您在编译时用完了 RAM。添加交换分区或通过 apt-get 安装 Pandas:sudo apt-get install python-pandas
  • 是的,在与other people类似的情况下也发生过这样的事情。
  • 创建交换分区后工作

标签: python ubuntu pip python-2.x digital-ocean


【解决方案1】:

这可能是权限问题。你试过了吗:

$ sudo pip install pandas

【讨论】:

    【解决方案2】:

    看起来 gcc 由于内存不足而被杀死(请参阅@Blender's comment) 暴露了 pip 中的一个错误。它在记录时混合了字节串和 Unicode,导致:

    >>> '\n'.join(['bytestring with non-ascii character ☺', u'unicode'])
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 36: \
       ordinal not in range(128)
    

    如果可以用最新的pip 版本重现;你可以report the bug

    【讨论】:

    • to upgradepip install --upgrade pip(升级为我解决了这个问题)
    • 在 ubuntu 上,我无法升级 pip,直到我使用 apt-get remove python-pip 删除了 ubuntu 包,然后运行上述升级代码。
    猜你喜欢
    • 1970-01-01
    • 2018-11-02
    • 1970-01-01
    • 1970-01-01
    • 2017-05-21
    • 1970-01-01
    • 2018-08-25
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多