I am trying to learn Python on Visual Studio Code and I have downloaded Python extensions but when I write a code and press run I see this
[Running] swift "c:UserswDesktoppython" 'swift' is not recognized as an internal or external command, operable program or batch file. [Done] exited with code=1 in 0.317 seconds
I tried to make sure that I have installed all python extensions and I was expecting the code to run
2
Answers
Double check that your launch.json is fine. (.vscode/launch.json).
If it doesnt exist, create it and put something like this inside it.
Hope it helps. Also, i’ve noticed that it was trying to run swift, which is a bit odd, so yeah i think your launch.json just might be messed up. I can’t know for sure tho, so post it please
The error message says you are running code with the Code Runner extension, which is incorrect. Please use the official extension Python to execute the script.
It would be helpful to follow this documentation.