0

每当我保存 .py 文件时,即使它是新文件,我的输出窗口也会出现错误...我认为是因为 Pylance,但我可以毫无问题地使用它。

我是 Python 新手,我真的不知道如何解决这个问题。

这是我收到的信息:

"""

用户属于实验组'pythonaacf' 用户属于实验组'pythonSendEntireLineToREPL' 用户属于实验组'pythonNotDisplayLinterPrompt' 用户属于实验组'pythonTensorboardExperimentcf' 用户属于实验组'ShowExtensionSurveyPrompt - enabled' 用户属于实验组'CollectLSRequestTiming -控制'

conda --version pyenv root python3.7 c:\Users\jvald.vscode\extensions\ms-python.python-2021.3.658691958\pythonFiles\pyvsc-run-isolated.py -c "import sys;print(sys.executable )" python3.6 c:\Users\jvald.vscode\extensions\ms-python.python-2021.3.658691958\pythonFiles\pyvsc-run-isolated.py -c "import sys;print(sys.executable)" python3 c :\Users\jvald.vscode\extensions\ms-python.python-2021.3.658691958\pythonFiles\pyvsc-run-isolated.py -c "import sys;print(sys.executable)" python2 c:\Users\jvald. vscode\extensions\ms-python.python-2021.3.658691958\pythonFiles\pyvsc-run-isolated.py -c "import sys;print(sys.executable)" python c:\Users\jvald.vscode\extensions\ms- python.python-2021.3.658691958\pythonFiles\pyvsc-run-isolated.py -c "import sys;print(sys.executable)" py -3.7 c:\Users\jvald.vscode\extensions\ms-python.python-2021.3.658691958\pythonFiles\pyvsc-run-isolated.py -c "import sys;print(sys.executable)" py -3.6 c:\Users\jvald.vscode\extensions\ ms-python.python-2021.3.658691958\pythonFiles\pyvsc-run-isolated.py -c "import sys;print(sys.executable)" py -3 c:\Users\jvald.vscode\extensions\ms-python。 python-2021.3.658691958\pythonFiles\pyvsc-run-isolated.py -c "import sys;print(sys.executable)" ~\AppData\Local\Programs\Python\Python39\python.exe c:\Users\jvald. vscode\extensions\ms-python.python-2021.3.658691958\pythonFiles\pyvsc-run-isolated.py -c "import sys;print(sys.executable)" py -2 c:\Users\jvald.vscode\extensions\ ms-python.python-2021.3.658691958\pythonFiles\pyvsc-run-isolated.py -c "import sys;print(sys.executable)" ~\anaconda3\Scripts\conda.exe info --json 错误 2021-03-17 13:12:00:检测命令 py 和 args -2 的 Python 解释器失败,因为找不到文件 Python 2!

-3.9-64 -3.8-64 -3.6-64 不存在 错误 2021-03-17 13:12:00:检测命令 py 和 args -3.7 的 Python 解释器失败,因为找不到文件 Python 3.7!

-3.9-64 -3.8-64 -3.6-64 不存在 Python 解释器路径:~\AppData\Local\Programs\Python\Python39\python.exe 启动 Jedi Python 语言引擎。

~\anaconda3\Scripts\conda.exe info --json ~\AppData\Local\Programs\Python\Python39\python.exe c:\Users\jvald.vscode\extensions\ms-python.python-2021.3.658691958\pythonFiles \pyvsc-run-isolated.py pylint --disable=all --enable=F,unreachable,duplicate-key,unnecessary-semicolon,global-variable-not-assigned,unused-variable,unused-wildcard-import,binary-操作异常,错误格式字符串,异常反斜杠字符串,错误打开模式,E0001,E0011,E0012,E0100,E0101,E0102,E0103,E0104,E0105,E0107,E0108,E0110,E0111, E0112,E0113,E0114,E0115,E0116,E0117,E0118,E0202,E0203,E0211,E0213,E0236,E0237,E0238,E0239,E0240,E0241,E0301,E0302,E0303,E0401,E0402,E0601,E0602,E0603, E0604,E0611,E0632,E0633,E0701,E0702,E0703,E0704,E0710,E0711,E0712,E1003,E1101,E1102,E1111,E1120,E1121,E1123,E1124,E1125,E1126,E1127,E1128,E1129,E1130, E1131,E1132,E1133,E1134,E1135,E1136,E1137,E1138,E1139,E1200,E1201,E1205,E1206,E1300,E1301,E1302,E1303,E1304,E1305,E1306,E1310,E1700,E1701 --msg-template='{line},{column},{category},{symbol}: {msg}' --reports=n --output-format=text "d:\012_PYTHON\Udemy\004.Postgree 和 SQL\02.Start Postgree\psycopg2-binary.py" cwd: d:\012_PYTHON\Udemy\ 004.Postgree 和 SQL ~\AppData\Local\Programs\Python\Python39\python.exe c:\Users\jvald.vscode\extensions\ms-python.python-2021.3.658691958\pythonFiles\pyvsc-run-isolated.py pylint --disable=all --enable=F,unreachable,duplicate-key,unnecessary-semicolon,global-variable-not-assigned,unused-variable,unused-wildcard-import,binary-op-exception,bad-format-字符串,字符串中的异常反斜杠,错误打开模式,E0001,E0011,E0012,E0100,E0101,E0102,E0103,E0104,E0105,E0107,E0108,E0110,E0111,E0112,E0113,E0114,E0115, E0116,E0117,E0118,E0202,E0203,E0211,E0213,E0236,E0237,E0238,E0239,E0240,E0241,E0301,E0302,E0303,E0401,E0402,E0601,E0602,E0603,E0604,E0611,E0632,E0633,E0701,E0702,E0703,E0704,E0710,E0711,E0712,E1003,E1101, E1102,E1111,E1120,E1121,E1123,E1124,E1125,E1126,E1127,E1128,E1129,E1130,E1131,E1132,E1133,E1134,E1135,E1136,E1137,E1138,E1139,E1200,E1201,E1205,E1206, E1300,E1301,E1302,E1303,E1304,E1305,E1306,E1310,E1700,E1701 --msg-template='{line},{column},{category},{symbol}:{msg}' --reports= n --output-format=text "d:\012_PYTHON\Udemy\004.Postgree 和 SQL\02.Start Postgree\psycopg2-binary.py" cwd: d:\012_PYTHON\Udemy\004.Postgree 和 SQL ~\anaconda3 \Scripts\conda.exe 环境列表#########Linting 输出 - pylint##########E1124,E1125,E1126,E1127,E1128,E1129,E1130,E1131,E1132,E1133,E1134,E1135,E1136,E1137,E1138,E1139,E1200,E1201,E1205,E1206,E1300,E1301,E1302,E1303,E1304, E1305,E1306,E1310,E1700,E1701 --msg-template='{line},{column},{category},{symbol}:{msg}' --reports=n --output-format=text "d :\012_PYTHON\Udemy\004.Postgree 和 SQL\02.Start Postgree\psycopg2-binary.py" cwd: d:\012_PYTHON\Udemy\004.Postgree 和 SQL ~\anaconda3\Scripts\conda.exe 环境列表## ########Linting 输出 - pylint##########E1124,E1125,E1126,E1127,E1128,E1129,E1130,E1131,E1132,E1133,E1134,E1135,E1136,E1137,E1138,E1139,E1200,E1201,E1205,E1206,E1300,E1301,E1302,E1303,E1304, E1305,E1306,E1310,E1700,E1701 --msg-template='{line},{column},{category},{symbol}:{msg}' --reports=n --output-format=text "d :\012_PYTHON\Udemy\004.Postgree 和 SQL\02.Start Postgree\psycopg2-binary.py" cwd: d:\012_PYTHON\Udemy\004.Postgree 和 SQL ~\anaconda3\Scripts\conda.exe 环境列表## ########Linting 输出 - pylint##########py" cwd: d:\012_PYTHON\Udemy\004.Postgree 和 SQL ~\anaconda3\Scripts\conda.exe 环境列表#########Linting 输出 - pylint######### #py" cwd: d:\012_PYTHON\Udemy\004.Postgree 和 SQL ~\anaconda3\Scripts\conda.exe 环境列表#########Linting 输出 - pylint######### #

"""

这是我的设置 Json:

{
"jupyter.askForKernelRestart": false,
"editor.tokenColorCustomizations": {
    "textMateRules": [
        {
            "scope": "meta.function-call.generic",
            "settings": {
                "foreground":"#2ecde2"
            }
        }
    ]
},
"workbench.colorTheme": "Solarized Dark",
"window.zoomLevel": 1,
"editor.mouseWheelZoom": true,
"editor.quickSuggestions": true,
"workbench.iconTheme": "vscode-icons",
"indentRainbow.colors": [


    

    "rgba(255,255,64,0.03)",
    "rgba(127,255,127,0.03)",
    "rgba(255,127,255,0.03)",
    "rgba(79,236,236,0.03)"
],
"workbench.editorAssociations": [
    {
        "viewType": "jupyter.notebook.ipynb",
        "filenamePattern": "*.ipynb"
    }
],
"code-runner.runInTerminal": true,
"emmet.extensionsPath": "",
"php.validate.run": "onType",
"python.defaultInterpreterPath": "C:\\Users\\jvald\\AppData\\Local\\Programs\\Python\\Python39\\",

}

谢谢

这是一个截图

在此处输入图像描述

4

1 回答 1

0

根据你提供的信息,他们展示了VS Code加载相关扩展、加载语言服务、执行python脚本等过程。

请尝试重新安装“ Python ”扩展并重新打开 VS Code。

于 2021-03-19T01:27:18.737 回答