To solve this problem add following to your code,

import sys
reload(sys)
sys.setdefaultencoding('utf-8')

using reload is important otherwise you will get following error,

>>> sys.setdefaultencoding
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'setdefaultencoding'

Reference:

https://stackoverflow.com/questions/10406135/unicodedecodeerror-ascii-codec-cant-decode-byte-0xd1-in-position-2-ordinal

results matching ""

    No results matching ""