The above error might occur if you have compiled and installed Python from source on Ubuntu.

curl https://www.python.org/ftp/python/2.7.6/Python-2.7.6.tgz -o python.tgz

tar -xvzf python.tgz

cd Python-2.7.6/

./configure

make

make install

 

The error can be fixed by

./configure –enable-unicode=ucs4