0

I am currently trying to set up a virtualenv for python in VSCode. I never did that before so I tried to follow along some tutorials. The only problem I have is that I cant seem to get the virtualenv activated through my VSCode terminal, but it works with Command Prompt.

This is what I get in VSCode: VSCode Terminal

And this is what I get in Command Prompt: Command Prompt

Is there anything I should add for the VSCode terminal or am I confusing two different things right here? Thank you!

Baran Calisci
  • 77
  • 1
  • 6
  • 1
    The VSCode terminal is a Powershell terminal not Command Prompt, so you'll need to use `Scripts\Activate.ps1` instead of `Scripts\activate.bat` as mentioned at [virtualenv in PowerShell?](https://stackoverflow.com/questions/1365081/virtualenv-in-powershell) – shriakhilc Apr 02 '22 at 18:50
  • 1
    Or you could change VSCode settings to use CMD too [How do I change my vs code terminal to cmd.exe](https://stackoverflow.com/questions/59313899/how-do-i-change-my-vs-code-terminal-to-cmd-exe-instead-of-powershell) – shriakhilc Apr 02 '22 at 18:53
  • @shriakhilc Thank you. It worked, but I also needed to change my ExecutionPolicy for LocalMachine that was on Restricted. I didnt try changing the terminal, but I will keep the option in mind if I need it in the future. Thank you for the help! – Baran Calisci Apr 02 '22 at 19:34

0 Answers0