Reputation: 442
I initialized a virtualenv with a python 2.7 interpreter, and then selected it as the interpreter in VSCode.
I then changed the virtualenv interpreter to python 3.7, and the VSCode interpreter list does not reflects the change: it still shows the virtualenv interpreter as being python 2.7.
How can I force the cached interpreter list to be updated or flushed?
This is related to this issue.
Upvotes: 19
Views: 28799
Reputation: 365
According to this comment, as of October 2021 it is possible to refresh the list of interpreters by doing F1, typing "Python: Select interpreter", and clicking on the circular arrow icon in the top-left corner of the menu.
Upvotes: 3
Reputation: 695
Running those 2 commands in the command palette worked for me.
As mentioned in the GitHub issue here Kudos to ericsnowcurrently
Upvotes: 10
Reputation: 442
At last I found a way to remove no-longer existing interpreters from the cache :
I guess the lookup is only done at launch, and not upon interpreter selection...
Upvotes: 12