首页 > 其他分享 >Pycharm报错 : SyntaxError: Non-ASCII character ' but no encoding declared;

Pycharm报错 : SyntaxError: Non-ASCII character ' but no encoding declared;

时间:2023-03-16 13:44:06浏览次数:40  
标签:Non encoding -- no character declared 报错

 

File "D:/03 ��ѧ/2023�괺��Python/0310/����ѧ�ź������Ƚ�v3--��Ѷ���鿼��ר��--12��.py", line 1
SyntaxError: Non-ASCII character '\xe6' in file D:/03 ��ѧ/2023�괺��Python/0310/����ѧ�ź������Ƚ�v3--��Ѷ���鿼��ר��--12��.py on line 1, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details

解决方法;

 在代码文件的第一行加入:

# coding=utf-8

标签:Non,encoding,--,no,character,declared,报错
From: https://www.cnblogs.com/emanlee/p/17222243.html

相关文章