Skip to content Skip to sidebar Skip to footer

How To Make The Python Debug Task Use The Default Powershell Profile?

I am trying to run a Python file in debug mode, and I get an error because the Powershell integrated terminal it starts is bare. To get it to work, I want it to use the following p

Solution 1:

You need to init conda first.

Run conda init command in any terminal.

It will create a profile.ps1 file under the folder of C:\Users{UserName}\Documents\WindowsPowerShell.

After that, if you open the PowerShell, conda will work. It equals to C:/Users/Marko/anaconda3/shell/condabin/conda-hook.ps1

Solution 2:

If you want conda environment is activated every time opening an new integrated Terminal, after selecting conda environment as interpreter, what you need to do is pressing Ctrl+Shift+` to open a Terminal

  1. run conda activate <envname>

  2. In Settings.json, set "python.terminal.activateEnvironment": true

Then no matter run or debug code, Terminal is always activated automatically:

enter image description here

Post a Comment for "How To Make The Python Debug Task Use The Default Powershell Profile?"