18

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
  • 4,261
  • 5
  • 20
  • 28

2 Answers2

12

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.

Community
  • 1
  • 1
jfs
  • 346,887
  • 152
  • 868
  • 1,518
  • 3
    and [to upgrade](http://stackoverflow.com/a/15223296/1224255), `pip install --upgrade pip` (upgrading fixed this for me) – TheGrimmScientist Oct 02 '15 at 23:06
  • 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. – Sam May 04 '16 at 09:50
0

It might be a permissions issue. Did you try:

$ sudo pip install pandas

There
  • 152
  • 2
  • 13