- 下面的错误比较奇葩,用注释代码排错的方法,哪怕全部代码都注释掉,只写一个print语句依然报错,只能说莫名其妙,报错内容如下,解决方法就是新建一个文件,把该文件里面的东西全部都拷贝过去
Traceback (most recent call last): File "C:\Users\jiangkainan\Anaconda3\lib\tokenize.py", line 390, in find_cookie line_string = line.decode('utf-8')UnicodeDecodeError: 'utf-8' codec can't decode byte 0xfe in position 0: invalid start byteDuring handling of the above exception, another exception occurred:Traceback (most recent call last): File "C:\Users\jiangkainan\Anaconda3\lib\site-packages\IPython\core\interactiveshell.py", line 2963, in run_code exec(code_obj, self.user_global_ns, self.user_ns) File "", line 1, in runfile('D:/Documents/_source/pycharm/1.py', wdir='D:/Documents/_source/pycharm') File "C:\Program Files\JetBrains\PyCharm 2018.2.3\helpers\pydev\_pydev_bundle\pydev_umd.py", line 197, in runfile pydev_imports.execfile(filename, global_vars, local_vars) # execute the script File "C:\Program Files\JetBrains\PyCharm 2018.2.3\helpers\pydev\_pydev_imps\_pydev_execfile.py", line 11, in execfile stream = tokenize.open(file) # @UndefinedVariable File "C:\Users\jiangkainan\Anaconda3\lib\tokenize.py", line 454, in open encoding, lines = detect_encoding(buffer.readline) File "C:\Users\jiangkainan\Anaconda3\lib\tokenize.py", line 431, in detect_encoding encoding = find_cookie(first) File "C:\Users\jiangkainan\Anaconda3\lib\tokenize.py", line 395, in find_cookie raise SyntaxError(msg) File " ", line NoneSyntaxError: invalid or missing encoding declaration for 'D:/Documents/_source/pycharm/1.py'