错误SyntaxError: Non-ASCII character '\xe4' in file cmd.py on line 12, but no encoding declared; see h

SyntaxError: Non-ASCII character '\xe4' in file cmd.py on line 12, but no encoding declared; see http://www.python.org/peps/pep-0263.html for details

解决
python2 会出现以上问题,python3以上版本不会
在文件的开头加
#-- coding:utf-8 --
必须在文件第一行开头写否则加了也会出错以上错



  上一篇:报错AttributeError: module 'pexpect' has no attribute 'spawn' 下一篇:报错django.core.exceptions.ImproperlyConfigured: SQLite 3.8.3 or later is required (found 3.7.17).  

湘ICP备19016894号 © 2019 小钱