There are several reasons why you might see the SyntaxError: invalid syntax error in a line with apparently valid syntax.