在MacOs运行的PyCharm中,执行python文件,如果不指定python文件字符编码会报错: SyntaxError: Non-ASCII character ‘\xe6’ in file /Users/yuchao/PycharmProjects/oldboy_python/python_lesson/模块与包/spam.py on line 6, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details 所以 找到FIle > Default settings > Editor