Skip to content

Trouble detecting environments #14909

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
thierry-bm opened this issue Dec 8, 2020 · 9 comments
Closed

Trouble detecting environments #14909

thierry-bm opened this issue Dec 8, 2020 · 9 comments
Assignees
Labels
area-environments Features relating to handling interpreter environments bug Issue identified by VS Code Team member as probable bug

Comments

@thierry-bm
Copy link

thierry-bm commented Dec 8, 2020

Environment data

  • VS Code version: 1.51.1
  • Extension version (available under the Extensions sidebar): v2020.11.371526539
  • OS and version: Windows 10
  • Python version (& distribution if applicable, e.g. Anaconda): Python 3.8
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): venv
  • Value of the python.languageServer setting: Pylance

Expected behaviour

The extension finds all interpreters listed under the venv Path variable.

Actual behaviour

The interpreter finds none of them (except those already in cache?)

Steps to reproduce:

Note too sure. For a while the select interpreter worked flawlessly but not anymore.

Logs

Error 2020-12-08 09:00:48: Failed to get interpreter information for 'C:\Users\xxx\venvs\ptf7\Scripts\python.exe' [Error: Command failed: "C:\\Users\xxx\venvs\ptf7\Scripts\python.exe" "c:\Users\xxx\.vscode\extensions\ms-python.python-2020.11.371526539\pythonFiles\pyvsc-run-isolated.py" "c:\Users\xxx\.vscode\extensions\ms-python.python-2020.11.371526539\pythonFiles\interpreterInfo.py"

	at ChildProcess.exithandler (child_process.js:304:12)
	at ChildProcess.emit (events.js:223:5)
	at maybeClose (internal/child_process.js:1021:16)
	at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)] {
  killed: true,
  code: null,
  signal: 'SIGTERM',
  cmd: '"C:\\\\Users\\xxx\\venvs\\ptf7\\Scripts\\python.exe" "c:\\Users\\xxx\\.vscode\\extensions\\ms-python.python-2020.11.371526539\\pythonFiles\\pyvsc-run-isolated.py" "c:\\Users\\xxx\\.vscode\\extensions\\ms-python.python-2020.11.371526539\\pythonFiles\\interpreterInfo.py"'

However the above command when pasted in a new terminal window works flawlessly:

{"versionInfo": [3, 7, 5, "final", 0], "sysPrefix": "C:\\Users\\xxx\\venvs\\ptf7", "sysVersion": "3.7.5 (tags/v3.7.5:5c02a39a0b, Oct 15 2019, 00:11:34) [MSC v.1916 64 bit (AMD64)]", "is64Bit": true}
@thierry-bm thierry-bm added triage-needed Needs assignment to the proper sub-team bug Issue identified by VS Code Team member as probable bug labels Dec 8, 2020
@cpoptic
Copy link

cpoptic commented Dec 8, 2020

+1 to this issue.
Also on python extension version v2020.11.371526539

The the select interpreter worked fine but broke I suspect with the latest release.

@ghost ghost removed the triage-needed Needs assignment to the proper sub-team label Dec 8, 2020
@karthiknadig karthiknadig added area-environments Features relating to handling interpreter environments triage-needed Needs assignment to the proper sub-team and removed triage-needed Needs assignment to the proper sub-team labels Dec 8, 2020
@kimadeline
Copy link

Hi everyone, thank you for reaching out.

The extension finds all interpreters listed under the venv Path variable.

Which setting are you using here, python.venvPath or python.venvFolders?

the above command when pasted in a new terminal window

Do you mean a new terminal window opened in VS Code? Which terminal are you using?

Thanks!

@thierry-bm
Copy link
Author

Hi Kim, I use python.venvPath, it's set to "C:\\Users\\xxx\\venvs" (my home folder is anonymized). In it there are a bunch of virtual environments. Is it the correct variable to use?

The command works in a vs code terminal instance or directly in the windows cmd prompt.

@thierry-bm
Copy link
Author

Hello, just to let you know, I'm quite perplexed since as of today all my environments are correctly listed by the extension. I have no idea what might have changed since I opened this issue last week.

@kimadeline
Copy link

Hi @thierry-bm, thank you for the heads-up! Maybe the cache refreshed? In any case, I will be closing this issue for now, and if the problem reappears feel free to leave a comment here and we'll can reopen it, or open a new issue.

Thanks!

@ghost ghost removed the triage label Dec 14, 2020
@thierry-bm
Copy link
Author

Hello Python extension team, unfortunately I keep encountering this problem. It's very erratic. Sometimes it only lists some virtual environments, sometimes (but rarely and I can't figure under which circumstances) all of them are correctly listed, and sometimes, only one interpreter is available.

@kimadeline
Copy link

I'm sorry to hear about this random behaviour 😟 We are working on refactoring our environment discovery logic (#12020), which may solve these issues once it lands (or at least, make it easier to investigate).

@thierry-bm
Copy link
Author

thierry-bm commented Jan 7, 2021

Glad to hear it. Let me know if I you need additional details. Thanks !

@kimadeline
Copy link

Sounds good! Feel free to subscribe to #12020 to get notified when the new interpreter discovery logic becomes available (on an opt-in basis as first) 👍

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 5, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-environments Features relating to handling interpreter environments bug Issue identified by VS Code Team member as probable bug
Projects
None yet
Development

No branches or pull requests

4 participants