我有一个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.