microsoft / vscode-python

Python extension for Visual Studio Code
https://aka.ms/pvsc-marketplace
MIT License
4.25k stars 1.15k forks source link

Broken/Removed virtual environment can not be cleared #23504

Open rebornix opened 1 month ago

rebornix commented 1 month ago

Testing #23482

I have an environment that's invalid but already removed (folder removed), but it can never be cleared (Clear Cache and Reload Window doesn't work).

Thus the log always prints following error. The only way to get rid of it is starting with a new user data dir. I ran into this with both JS and Native finder.

2024-05-28 10:28:44.342 [error] Error: Command failed: /Users/penlv/code/work/vscode-jupyter/src/test/datascience/.venvnokernel/bin/python -I /Users/penlv/.vscode-insiders/extensions/ms-python.python-2024.7.0-dev/python_files/get_output_via_markers.py /Users/penlv/.vscode-insiders/extensions/ms-python.python-2024.7.0-dev/python_files/interpreterInfo.py
/bin/sh: /Users/penlv/code/work/vscode-jupyter/src/test/datascience/.venvnokernel/bin/python: No such file or directory

    at ChildProcess.exithandler (node:child_process:423:12)
    at ChildProcess.emit (node:events:526:35)
    at maybeClose (node:internal/child_process:1105:16)
    at Socket.<anonymous> (node:internal/child_process:457:11)
    at Socket.emit (node:events:514:28)
    at Pipe.<anonymous> (node:net:337:12) {
  code: 127,
  killed: false,
  signal: null,
  cmd: '/Users/penlv/code/work/vscode-jupyter/src/test/datascience/.venvnokernel/bin/python -I /Users/penlv/.vscode-insiders/extensions/ms-python.python-2024.7.0-dev/python_files/get_output_via_markers.py /Users/penlv/.vscode-insiders/extensions/ms-python.python-2024.7.0-dev/python_files/interpreterInfo.py'
}
DonJayamanne commented 1 month ago

Possible you have this setup as the active environment or the like.