Search code examples
pythonvisual-studio-codeerror-handlingpylance

I am gettting Error in my output Python in Visual Studio


whenever I save a .py file, even if it's new, I get an error in my output window... I think is because of Pylance but I can use it without a problem.

I am new in Python and I don't really know how to fix that.

This is the message I get:

"""

User belongs to experiment group 'pythonaacf' User belongs to experiment group 'pythonSendEntireLineToREPL' User belongs to experiment group 'pythonNotDisplayLinterPrompt' User belongs to experiment group 'pythonTensorboardExperimentcf' User belongs to experiment group 'ShowExtensionSurveyPrompt - enabled' User belongs to experiment group 'CollectLSRequestTiming - control'

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 Error 2021-03-17 13:12:00: Detection of Python Interpreter for Command py and args -2 failed as file Python 2 not found!

-3.9-64 -3.8-64 -3.6-64 does not exist Error 2021-03-17 13:12:00: Detection of Python Interpreter for Command py and args -3.7 failed as file Python 3.7 not found!

-3.9-64 -3.8-64 -3.6-64 does not exist Python interpreter path: ~\AppData\Local\Programs\Python\Python39\python.exe Starting Jedi Python language engine.

~\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-op-exception,bad-format-string,anomalous-backslash-in-string,bad-open-mode,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 and SQL\02.Start Postgree\psycopg2-binary.py" cwd: d:\012_PYTHON\Udemy\004.Postgree and 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-string,anomalous-backslash-in-string,bad-open-mode,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 and SQL\02.Start Postgree\psycopg2-binary.py" cwd: d:\012_PYTHON\Udemy\004.Postgree and SQL ~\anaconda3\Scripts\conda.exe env list ##########Linting Output - pylint##########

"""

This is my Settings 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\\",

}

Thank you

This is a ScreenShot

enter image description here


Solution

  • According to the information you provided, they show the process of VS Code loading related extensions, loading language services, and executing python scripts, and so on.

    Please try to reinstall the "Python" extension and reopen VS Code.