I'm having trouble with the shell in Visual Code Studio in WSL

I'm a Visual Code Studio user. I have used the CMD default shell in Visual Studio Code but I passed on ubuntu a few days ago. So I also change the Visual Studio Code default shell by replacing it with ubuntu(wsl). The problem is that when I try to run my script it writes :-bash: C:/Program Files/Python310/python.exe: No such file or directory. By the way I'm a Python language user.

0

1 Answer

You don't need WSL to access a bash shell in Visual Studio Code. The most normal way to do it is to install the git-bash app and Visual Studio Code in Windows and then you can access all your installed Python files in Windows from Visual Studio Code and use a bash shell in Visual Studio Code in Windows too.

Start git-bash Visual Studio Code extension adds two "bash" commands to VSCode that allow you to start git-bash, either in the folder of the current file or in the workspace's root folder. Open your preferred browser and visit Git Bash downloads page by clicking the following link: Git Download Page. Once the page loads, click the Download for Windows button.

Plugin provides two commands:

  • bash will open bash in your current file's directory.
  • bash in workspace will open bash always in the root workspace directory, despite what file is opened.

Just press F1 and then type any of above commands to start git-bash.exe.

Note that you will need to have git-bash.exe on the environment path.

2

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like