1

I've been struggling for a long time now to get this running but I just couldn't do it. I am runnning PyCharm Professional on Win10 and I want to code and run Shell scripts, but I cannot get it to work. There is this Shell Plugin from Pycharm but there is just not enough documention for me to understand how it has to be setup. How do I have to setup PyCharm in order to Run/Debug Shell scripts?

I tried changing the shell used by the Terminal to the WSL Ubuntu shell, which actually worked. Thus I can now manually execute the bash script via the terminal.

I also tried changing the Run/Debug configuration. changed Run/Debug configuration

as suggesteed, changing the interpreter to bash.exe led to an error message. interpreter changed to bash.exe

I tried bash.exe, ubuntu.exe and cmd.exe as shells for terminal, all of which threw a file not found error. As before executing it manually with the wsl path format(/mnt/c/..) works. manual execution

"file not found"-error

9
  • Can you show us what you have tried? Commented Mar 5, 2020 at 11:52
  • You cannot run shell scripts natively on Windows. You need a proper environment, such as WSL, Windows Subsystem for Linux. If the PyCharm version is >= 2018.3 EAP 7, WSL support is there - for Python configuration is quite simple, run "Add Python interpreter". You can also set the terminal to point to the WSL, go to Settings > Tools > Terminal > Application settings and put wsl.exe in the "shell path" field. Commented Mar 5, 2020 at 12:13
  • @KasiaGauza That's exactly what I want to do! :-) I just edited the question. Getting the Terminal to use WSL worked but getting the Run/Debug function to work is where my problem lies. Commented Mar 5, 2020 at 12:15
  • I think what I am looking for is a way to set the interpreter PC uses for shell scripts?! Commented Mar 5, 2020 at 12:22
  • I guess, in this case the interpreter should be bash.exe, rather than ubuntu.exe (btw. please run test in PowerShell or cmd: bash -c 'ls -l') Commented Mar 5, 2020 at 12:50

1 Answer 1

1

So I guess it was my misunderstanding in the end, that you can't really work with shell scripts like you do with python. meaning debugging etc and watching variables. I am trying to reduce my file shuffling code in bash anyways and try to stay mainly in python so there is now another motivation for that. thank you very much for helping me though.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.