2

I always used the "Run python file in terminal"-button in Vscode, but some recent update seems to have broken it for me. My default terminal is cmd, but when I use the button, it now uses powershell and does not activate the conda environment, which prevents my code from running. enter image description here

When I open up a new terminal manually, it rightfully uses cmd, activates the env and python <path> works again. This is the output after pressing the run-button: enter image description here

Does anyone know how to set the button to use cmd?

  • this is a duplicate of https://stackoverflow.com/questions/52601198/vscode-virtual-studio-code-unable-to-load-conda-environment-in-vscode-termina?rq=1 – Gunesh Shanbhag Sep 13 '21 at 08:13
  • Does this answer your question? [VSCode / Virtual Studio Code: Unable to Load Conda Environment in VSCode Terminal](https://stackoverflow.com/questions/52601198/vscode-virtual-studio-code-unable-to-load-conda-environment-in-vscode-termina) – Gunesh Shanbhag Sep 13 '21 at 08:13
  • This is an old solution, which I used before. Vscode now flags these setting parameters as deprecated and tells me to change the setting above now. I tried the solution just to be sure, to no effect. – DoubleSteakHouse Sep 13 '21 at 08:32
  • I am wondering if it is a side affect of the known bug currently in the 1.60 release: https://stackoverflow.com/questions/69047142/vscode-is-suddenly-defaulting-to-powershell-for-integrated-terminal-and-tasks – Timothy G. Sep 13 '21 at 12:21
  • do Stackoverflow have some kind of bot because I didnt typed the second comment. – Gunesh Shanbhag Sep 13 '21 at 13:34

1 Answers1

1

This is an issue of Python Extension. And it should be fixed tomorrow with the new release. You can refer to here for more details.

And have you add "python.terminal.activateEnvironment": true, in the settings.json file? Because it's weird, as the cmd activates the environment while the Powershell does not.

Steven-MSFT
  • 7,438
  • 1
  • 5
  • 13