Python extension does not detect Python installations and throws an error
See original GitHub issueEnvironment data
- VS Code version: 1.56.2
- Extension version (available under the Extensions sidebar): XXX
- OS and version: v2021.5.842923320
- Python version (& distribution if applicable, e.g. Anaconda): 3.9.5, standard installation
- Type of virtual environment used (N/A | venv | virtualenv | conda | …): venv and global installation
- Value of the
python.languageServer
setting: Pylance - OS: Windows 10 1809 Build 17763.1935
Expected behaviour
The extension should correctly detect the installed python version without errors.
Actual behaviour
Extension fails to detect Python and throws an error in the output.
Steps to reproduce:
- Install python extension, open a python file.
Logs
Python extension output
Error 2021-06-04 16:23:57: Failed to get interpreter information for 'C:\Program Files\Python39\python.exe' [Error: Command failed: "C:\\Program Files\Python39\python.exe" "c:\Users\mlodozk\.vscode\extensions\ms-python.python-2021.5.842923320\pythonFiles\pyvsc-run-isolated.py" "c:\Users\mlodozk\.vscode\extensions\ms-python.python-2021.5.842923320\pythonFiles\interpreterInfo.py"
[91mParserError:
[96mLine |
[96m 1 | [0m … python.exe" [96m"c:\Users\mlodozk\.vscode\extensions\ms-python.python-202[0m …
[96m | [91m ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[91m[96m | [91mUnexpected token
[96m | [91m'"c:\Users\mlodozk\.vscode\extensions\ms-python.python-2021.5.842923320\pythonFiles\pyvsc-run-isolated.py"' in expression or statement.
[0m
at ChildProcess.exithandler (child_process.js:317:12)
at ChildProcess.emit (events.js:315:20)
at maybeClose (internal/child_process.js:1048:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5)] {
killed: false,
code: 1,
signal: null,
cmd: '"C:\\\\Program Files\\Python39\\python.exe" "c:\\Users\\mlodozk\\.vscode\\extensions\\ms-python.python-2021.5.842923320\\pythonFiles\\pyvsc-run-isolated.py" "c:\\Users\\mlodozk\\.vscode\\extensions\\ms-python.python-2021.5.842923320\\pythonFiles\\interpreterInfo.py"'
}
Issue Analytics
- State:
- Created 2 years ago
- Comments:13 (1 by maintainers)
Top Results From Across the Web
VS Code claiming that python isn't installed even when an ...
I have python installed and I have pythonPath set, but whenever I open a python project folder I get this popup python-not-installed-popup.
Read more >VS Code Python installation and Python Interpreter not ...
This is interpreter error. you have to click on interpreter error showing bottom right in vs code then you choose installed latest python ......
Read more >What's New In Python 3.11 — Python 3.11.1 documentation
This article explains the new features in Python 3.11, compared to 3.10. For full details, see the changelog. Summary – Release highlights¶. Python...
Read more >Troubleshoot Python errors in Azure Functions - Microsoft Learn
This error occurs when a Python function app fails to load a Python module. The root cause for this error is one of...
Read more >Troubleshooting | PyCharm Documentation - JetBrains
Troubleshooting ; Package installation fails. pip is not available for a particular Python interpreter, or any of the installation requirements ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks for that, correcting the comspec fixed my issue with the extension!
Great, closing this.