[Solved]: UnicodeEncodeError: 'ascii' codec can't encode character u'\xa0' in position 20: ordinal not in range(128)

 Method 1:

Adding UTF-8 to .bashrc  will solved your problem:

export LC_CTYPE=en_US.UTF-8

Don’t forget to reload .bashrc afterwards:

source ~/.bashrc

Method 2:

Put this on your Python file:

# encoding=utf8import sysreload(sys)sys.setdefaultencoding('utf8')