question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Python extension does not detect Python installations and throws an error

See original GitHub issue

Environment 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. image

Steps to reproduce:

  1. 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"
ParserError: 
Line |
   1 |  … python.exe" "c:\Users\mlodozk\.vscode\extensions\ms-python.python-202 …
     |                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | Unexpected token
     | '"c:\Users\mlodozk\.vscode\extensions\ms-python.python-2021.5.842923320\pythonFiles\pyvsc-run-isolated.py"' in expression or statement.


	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:closed
  • Created 2 years ago
  • Comments:13 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
kwmlodozenieccommented, Jun 18, 2021

Thanks for that, correcting the comspec fixed my issue with the extension!

0reactions
karrtikrcommented, Jun 18, 2021

Great, closing this.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found