我有相当长一段时间以来在本地运行 Django 服务器。今天突然间我开始在运行调试模式时看到错误。它在正常模式下工作正常。
我尝试在 manage.py 中包含 utf-8 但仍然看到错误
pydev debugger: process 10424 is connecting
Connected to pydev debugger (build 192.6603.34)
pydev debugger: process 10425 is connecting
Traceback (most recent call last):
File "/Applications/PyCharm.app/Contents/helpers/pydev/pydevd.py", line 2066, in <module>
main()
File "/Applications/PyCharm.app/Contents/helpers/pydev/pydevd.py", line 2060, in main
globals = debugger.run(setup['file'], None, None, is_module)
File "/Applications/PyCharm.app/Contents/helpers/pydev/pydevd.py", line 1411, in run
return self._exec(is_module, entry_point_fn, module_name, file, globals, locals)
File "/Applications/PyCharm.app/Contents/helpers/pydev/pydevd.py", line 1418, in _exec
pydev_imports.execfile(file, globals, locals) # execute the script
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python", line 1
SyntaxError: Non-ASCII character '\xcf' in file /System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python on line 1, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details```
I expect it to run on debug mode. it already bloked me 1/2 day. Please help if you already have seen this issue or know how to fix this.