This error occurs when Python encounters a non-ASCII character in the source code file, but the file does not declare an encoding using a special comment at the top of the file. To fix this error, add the following comment at the top of your file:

# coding: utf-8

This tells Python that the file is encoded using UTF-8, which supports all Unicode characters. Replace 'utf-8' with the appropriate encoding if your file is encoded differently.

Python SyntaxError: Non-ASCII Character - How to Fix