'Python is not installed please install

I am installed python in vscode and also manually on the official website. However, when I run a python file in the Vscode, it complains. And also sometimes it complains that Python path in your debug configuration is invalid. I am trying to fix by deleting the .Vscode extension. However, the same result is happening now. The result is Python is not installed please install When I opened the view or developer tools the output looks like this below

Experiment 'pythonTensorboardExperiment' is active
Experiment 'PythonPyTorchProfiler' is active
Experiment 'pythonDeprecatePythonPath' is active
Experiment 'pythonInterpreterInfoUnpinned' is active
> conda info --json
> ~\AppData\Local\Programs\Python\Python39\python.exe ~\.vscode\extensions\ms-python.python-2022.0.1814523869\pythonFiles\get_output_via_markers.py ~\.vscode\extensions\ms-python.python-2022.0.1814523869\pythonFiles\interpreterInfo.py
[ERROR 2022-1-26 17:11:54.836]: [Error: spawn C:\Windows\system32\cmd.exe %JAVA_HOME%\bin ENOENT
    at Process.ChildProcess._handle.onexit (internal/child_process.js:269:19)
    at onErrorNT (internal/child_process.js:465:16)
    at processTicksAndRejections (internal/process/task_queues.js:80:21)] {
  errno: -4058,
  code: 'ENOENT',
  syscall: 'spawn C:\\Windows\\system32\\cmd.exe %JAVA_HOME%\\bin',
  path: 'C:\\Windows\\system32\\cmd.exe %JAVA_HOME%\\bin',
  spawnargs: [
    '-c',
    'C:\\Users\\sefineh\\AppData\\Local\\Programs\\Python\\Python39\\python.exe c:\\Users\\sefineh\\.vscode\\extensions\\ms-python.python-2022.0.1814523869\\pythonFiles\\get_output_via_markers.py c:\\Users\\sefineh\\.vscode\\extensions\\ms-python.python-2022.0.1814523869\\pythonFiles\\interpreterInfo.py'
  ],
  cmd: 'C:\\Users\\sefineh\\AppData\\Local\\Programs\\Python\\Python39\\python.exe c:\\Users\\sefineh\\.vscode\\extensions\\ms-python.python-2022.0.1814523869\\pythonFiles\\get_output_via_markers.py c:\\Users\\sefineh\\.vscode\\extensions\\ms-python.python-2022.0.1814523869\\pythonFiles\\interpreterInfo.py'
}
> ~\anaconda3\Scripts\conda.exe info --json
> ~\anaconda3\python.exe ~\.vscode\extensions\ms-python.python-2022.0.1814523869\pythonFiles\get_output_via_markers.py ~\.vscode\extensions\ms-python.python-2022.0.1814523869\pythonFiles\interpreterInfo.py
> ~\AppData\Local\Programs\Python\Python310\python.exe ~\.vscode\extensions\ms-python.python-2022.0.1814523869\pythonFiles\get_output_via_markers.py ~\.vscode\extensions\ms-python.python-2022.0.1814523869\pythonFiles\interpreterInfo.py
[ERROR 2022-1-26 17:11:56.66]: [Error: spawn C:\Windows\system32\cmd.exe %JAVA_HOME%\bin ENOENT
    at Process.ChildProcess._handle.onexit (internal/child_process.js:269:19)
    at onErrorNT (internal/child_process.js:465:16)
    at processTicksAndRejections (internal/process/task_queues.js:80:21)] {
  errno: -4058,
  code: 'ENOENT',
  syscall: 'spawn C:\\Windows\\system32\\cmd.exe %JAVA_HOME%\\bin',
  path: 'C:\\Windows\\system32\\cmd.exe %JAVA_HOME%\\bin',
  spawnargs: [
    '-c',
    'C:\\Users\\sefineh\\AppData\\Local\\Programs\\Python\\Python310\\python.exe c:\\Users\\sefineh\\.vscode\\extensions\\ms-python.python-2022.0.1814523869\\pythonFiles\\get_output_via_markers.py c:\\Users\\sefineh\\.vscode\\extensions\\ms-python.python-2022.0.1814523869\\pythonFiles\\interpreterInfo.py'
  ],
  cmd: 'C:\\Users\\sefineh\\AppData\\Local\\Programs\\Python\\Python310\\python.exe c:\\Users\\sefineh\\.vscode\\extensions\\ms-python.python-2022.0.1814523869\\pythonFiles\\get_output_via_markers.py c:\\Users\\sefineh\\.vscode\\extensions\\ms-python.python-2022.0.1814523869\\pythonFiles\\interpreterInfo.py'
}
> ~\anaconda3\Scripts\conda.exe run -n base --no-capture-output --live-stream python ~\.vscode\extensions\ms-python.python-2022.0.1814523869\pythonFiles\get_output_via_markers.py ~\.vscode\extensions\ms-python.python-2022.0.1814523869\pythonFiles\interpreterInfo.py
[ERROR 2022-1-26 17:12:16.201]: [Error: spawn C:\Windows\system32\cmd.exe %JAVA_HOME%\bin ENOENT
    at Process.ChildProcess._handle.onexit (internal/child_process.js:269:19)
    at onErrorNT (internal/child_process.js:465:16)
    at processTicksAndRejections (internal/process/task_queues.js:80:21)] {
  errno: -4058,
  code: 'ENOENT',
  syscall: 'spawn C:\\Windows\\system32\\cmd.exe %JAVA_HOME%\\bin',
  path: 'C:\\Windows\\system32\\cmd.exe %JAVA_HOME%\\bin',
  spawnargs: [
    '-c',
    'C:\\Users\\sefineh\\anaconda3\\Scripts\\conda.exe run -n base --no-capture-output --live-stream python c:\\Users\\sefineh\\.vscode\\extensions\\ms-python.python-2022.0.1814523869\\pythonFiles\\get_output_via_markers.py c:\\Users\\sefineh\\.vscode\\extensions\\ms-python.python-2022.0.1814523869\\pythonFiles\\interpreterInfo.py'
  ],
  cmd: 'C:\\Users\\sefineh\\anaconda3\\Scripts\\conda.exe run -n base --no-capture-output --live-stream python c:\\Users\\sefineh\\.vscode\\extensions\\ms-python.python-2022.0.1814523869\\pythonFiles\\get_output_via_markers.py c:\\Users\\sefineh\\.vscode\\extensions\\ms-python.python-2022.0.1814523869\\pythonFiles\\interpreterInfo.py'
}
[ERROR 2022-1-26 17:12:16.259]: No python is installed or a refresh has not already been triggered
> python -c "import sys;print(sys.executable)"
> python -c "import sys;print(sys.executable)"
> python -c "import sys;print(sys.executable)"
> python -c "import sys;print(sys.executable)"
> python -c "import sys;print(sys.executable)"
> python -c "import sys;print(sys.executable)"
> python -c "import sys;print(sys.executable)"
> python -c "import sys;print(sys.executable)"
> python -c "import sys;print(sys.executable)"
> python -c "import sys;print(sys.executable)"
> python -c "import sys;print(sys.executable)"
> python -c "import sys;print(sys.executable)"
> python -c "import sys;print(sys.executable)"
> python -c "import sys;print(sys.executable)"
Starting Pylance language server.
[ERROR 2022-1-26 17:12:20.984]: No python is installed or a refresh has not already been triggered
Diagnostic Code: NoPythonInterpretersDiagnostic, Message: Python is not installed. Please download and install Python before using the extension.
> python -c "import sys;print(sys.executable)"
> python -c "import sys;print(sys.executable)"
> python -c "import sys;print(sys.executable)"
> python -c "import sys;print(sys.executable)"
> python -c "import sys;print(sys.executable)"
> python -c "import sys;print(sys.executable)"
[ERROR 2022-1-26 17:13:36.706]: No python is installed or a refresh has not already been triggered
> ~\anaconda3\Scripts\conda.exe info --json
> python -c "import sys;print(sys.executable)"
> python -c "import sys;print(sys.executable)"
> python -c "import sys;print(sys.executable)"
> python -c "import sys;print(sys.executable)"
> python -c "import sys;print(sys.executable)"
> python -c "import sys;print(sys.executable)"
> python -c "import sys;print(sys.executable)"
> python -c "import sys;print(sys.executable)"
> python -c "import sys;print(sys.executable)"
> python ~\.vscode\extensions\ms-python.python-2022.0.1814523869\pythonFiles\get_output_via_markers.py ~\.vscode\extensions\ms-python.python-2022.0.1814523869\pythonFiles\interpreterInfo.py
[ERROR 2022-1-26 17:14:3.541]: [Error: spawn C:\Windows\system32\cmd.exe %JAVA_HOME%\bin ENOENT
    at Process.ChildProcess._handle.onexit (internal/child_process.js:269:19)
    at onErrorNT (internal/child_process.js:465:16)
    at processTicksAndRejections (internal/process/task_queues.js:80:21)] {
  errno: -4058,
  code: 'ENOENT',
  syscall: 'spawn C:\\Windows\\system32\\cmd.exe %JAVA_HOME%\\bin',
  path: 'C:\\Windows\\system32\\cmd.exe %JAVA_HOME%\\bin',
  spawnargs: [
    '-c',
    'python c:\\Users\\sefineh\\.vscode\\extensions\\ms-python.python-2022.0.1814523869\\pythonFiles\\get_output_via_markers.py c:\\Users\\sefineh\\.vscode\\extensions\\ms-python.python-2022.0.1814523869\\pythonFiles\\interpreterInfo.py'
  ],
  cmd: 'python c:\\Users\\sefineh\\.vscode\\extensions\\ms-python.python-2022.0.1814523869\\pythonFiles\\get_output_via_markers.py c:\\Users\\sefineh\\.vscode\\extensions\\ms-python.python-2022.0.1814523869\\pythonFiles\\interpreterInfo.py'
}
[ERROR 2022-1-26 17:14:3.541]: Invalid Python Path 'python'
[ERROR 2022-1-26 17:14:7.861]: Failed to handle invalid python path in launch.json debugger Error: cannot open file:///c%3A/Users/sefineh/Desktop/pytorchTraining/.vscode/launch.json. Detail: Unable to read file 'c:\Users\sefineh\Desktop\pytorchTraining\.vscode\launch.json' (Error: Unable to resolve nonexistent file 'c:\Users\sefineh\Desktop\pytorchTraining\.vscode\launch.json')
    at vscode-file://vscode-app/c:/Users/sefineh/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/out/vs/workbench/workbench.desktop.main.js:2379:76524
> python -c "import sys;print(sys.executable)"

Anyone can help me please? I am using windows 10



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source