SyntaxError: Non-UTF-8 code starting with '\x90' in file C:\Python36\python.exe on line 1, but no encoding declared

你说的曾经没有我的故事 提交于 2019-12-17 21:33:23

问题


SyntaxError: Non-UTF-8 code starting with '\x90' in file
C:\Python36\python.exe on line 1, but no encoding declared

I don't understand why it shows me that when I want to open the interpreter. Can someone help me please?


回答1:


Ok, it's a wrong value for PYTHONSTARTUP which was asking me a problem. Thank you all !




回答2:


Python 3 assumes scripts are saved with UTF-8 encoding. The script being executed (from PYTHONSTARTUP?) is not UTF-8-encoded. If you know the encoding, you can add it to the top of the script with:

#coding:cp1252     (or whatever the encoding is).

Or just re-save the script in UTF-8.

See also PEP 0263.



来源:https://stackoverflow.com/questions/47393026/syntaxerror-non-utf-8-code-starting-with-x90-in-file-c-python36-python-exe

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!