Selecting Python interpreter from WSL

Solution 1:

I think that, in order to use the WSL python, you need to be running VSCode in a WSL remote window. You need to install the Remote WSL extension first. Then, on the lower left there is a green button that will let you start a WSL window, or it will tell you that you are already in one.

This shows that you are in a WSL window

If you are in a WSL window, you should be able to select your python interpreter pretty easily. It will either automatically detect it, or you can run which python in an Ubuntu terminal to get the path. If you want to navigate to a file on your Windows file system from within this window, look in, e.g., /mnt/c/Users/<USER_NAME>.

Solution 2:

Well probably late to the party but you can find Python you are using on your WSL2 with simple command:

which python3

It will show you where is the python placed.