`pip install pandas` gives UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 41: ordinal not in range(128)

11,549

It looks like gcc being killed due to insufficient memory (see @Blender's comment) exposed a bug in pip. It mixes bytestrings and Unicode while logging that leads to:

>>> '\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)

If it is reproducible with the latest pip version; you could report the bug.

Share:
11,549

Related videos on Youtube

Athena Wisdom
Author by

Athena Wisdom

Updated on September 15, 2022

Comments

  • Athena Wisdom
    Athena Wisdom over 1 year

    When performing pip install pandas on a Digital Ocean 512MB droplet, I get the error UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 41: ordinal not in range(128) .

    Any ideas what may have caused it? I'm running Ubuntu 12.04 64bit.

    [Full Error]

    • Athena Wisdom
      Athena Wisdom over 10 years
      @Blender just added to the original post
    • Blender
      Blender over 10 years
      How much RAM do you have on your VPS? GCC is being killed by the OS, which probably means that you ran out of RAM while compiling. Either add a swap partition or just install Pandas via apt-get: sudo apt-get install python-pandas.
    • DSM
      DSM over 10 years
      Yeah, stuff like this has happened in similar situations to other people.
  • TheGrimmScientist
    TheGrimmScientist over 8 years
    and to upgrade, pip install --upgrade pip (upgrading fixed this for me)
  • Sam
    Sam almost 8 years
    On ubuntu I could not upgrade pip until I removed the ubuntu package using apt-get remove python-pip and then running the above upgrade code.