golpesar132 Posted July 1, 2017 Share Posted July 1, 2017 I use the serial library but when I import it. it will show an error. why? File "test.py", line 1 SyntaxError: Non-ASCII character '\xe2' in file test.py on line 1, but no encoding declared; see http://www.python.org/peps/pep-0263.html for details when i change coding, with the following code, it has the error again # coding: utf-8 how can i solve it?? Link to comment Share on other sites More sharing options...
martinayotte Posted July 1, 2017 Share Posted July 1, 2017 Your problem's description is not clear ... Can you show us what your test.py contains ? If you have utf-8 issues, you probably need to do a "export PYTHONIOENCODING=UTF-8" before starting your script. Link to comment Share on other sites More sharing options...
Recommended Posts