ab_Dominoble_dev
ab_Dominoble_dev

Reputation: 111

WSL VSCode call Windows Python Executable

I want Bash to call my Windows Python Executable when I run my python files. I am only using WSL so I can replace cmd/powershell with bash. I do not want to install anything on WSL, I want to use existing programs on Windows (in this case Python).

However when I try to run my Python file (Clicking 'play' button) I get the error:

-bash: C:/Users/Connor/AppData/Local/Programs/Python/Python310/python.exe: No such file or directory 

I believe this can be solved by replacing C: with \mnt\c

How can I achieve this?

enter image description here

Upvotes: 0

Views: 1261

Answers (1)

Ryan
Ryan

Reputation: 126

I had a same problem as yours. I solved this by following steps.

  1. Open the VSCode
  2. On your left-down side, you can see the the icon that I pointed enter image description here (the name in here is "Open a Remote Window")
  3. Next you can see above the "Reopen Folder in WSL" enter image description here and clicked
  4. Then you can run python with wsl and no more directory errors

Upvotes: 1

Related Questions