在PyCharm中配置Flask应用程序的调试器:“ UnicodeDecodeError:'utf-8'编解码器无法解码字节”

时间:2018-10-01 18:42:15

标签: python flask pycharm

我正在尝试在PyCharm IDE中为Flask应用程序配置调试器。

这是配置的样子: enter image description here

从命令行手动运行应用程序,而无需在PyCharm中进行调试即可运行应用程序。当我在PyCharm中单击Debug按钮时出现问题。尝试运行后出现以下错误:

Traceback (most recent call last):
  File "C:\Users\username\AppData\Local\Programs\Python\Python37-32\lib\tokenize.py", line 385, in find_cookie
    line_string = line.decode('utf-8')
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x90 in position 2: invalid start byte

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Program Files\JetBrains\PyCharm Community Edition 2018.2.4\helpers\pydev\pydevd.py", line 1664, in <module>
    main()
  File "C:\Program Files\JetBrains\PyCharm Community Edition 2018.2.4\helpers\pydev\pydevd.py", line 1658, in main
    globals = debugger.run(setup['file'], None, None, is_module)
  File "C:\Program Files\JetBrains\PyCharm Community Edition 2018.2.4\helpers\pydev\pydevd.py", line 1068, in run
    pydev_imports.execfile(file, globals, locals)  # execute the script
  File "C:\Program Files\JetBrains\PyCharm Community Edition 2018.2.4\helpers\pydev\_pydev_imps\_pydev_execfile.py", line 11, in execfile
    stream = tokenize.open(file)  # @UndefinedVariable
  File "C:\Users\username\AppData\Local\Programs\Python\Python37-32\lib\tokenize.py", line 449, in open
    encoding, lines = detect_encoding(buffer.readline)
  File "C:\Users\username\AppData\Local\Programs\Python\Python37-32\lib\tokenize.py", line 426, in detect_encoding
    encoding = find_cookie(first)
  File "C:\Users\username\AppData\Local\Programs\Python\Python37-32\lib\tokenize.py", line 390, in find_cookie
    raise SyntaxError(msg)
SyntaxError: invalid or missing encoding declaration for 'P:/PROJECTS_PYTHON/messenger_chatbot/venv/Scripts/flask.exe'

您有什么想法可能出问题吗?

平台:Windows 10

0 个答案:

没有答案