Python SyntaxError: Non-ASCII character ‘\xe2′ in file

When executing a python script you get the following error:

SyntaxError: Non-ASCII character ‘\xe2′ in file yourfilename.py on line 11, but no encoding declared; see http://www.python.org/peps/pep-0263.html for details

Solution:

Add the below line at top of the .py file

# coding: utf-8

Related posts:

This entry was posted in python. Bookmark the permalink.