MHA
MHA

Reputation: 69

How do I activate my virtual environment in Windows?

I'm using VSC and trying to activate my virtual environment through its terminal.

I've navigated to the project folder in terminal and ran:

virtualenv ll_env which seems to successfully create the virtual environment.

Now I tried to run ll_env/bin/activate and ll_env\Scripts\activate.bat to activate it but doesn't seem to do anything. Supposedly when I have activated it I'm supposed to see (ll_env)learning_log in terminal. Please help. I've attached a screenshot as well.

screenshot

Upvotes: 0

Views: 4915

Answers (3)

Tech
Tech

Reputation: 915

try this. I'm using Windows too. And working for me

cd Scripts
activate

Upvotes: 0

Molly Wang-MSFT
Molly Wang-MSFT

Reputation: 9451

Select Activate.ps1 and right-click to choose copy path, then paste it to terminal, press Enter to activate virtual environment:

enter image description here

And, with the default setting if you never change it:

"python.terminal.activateEnvironment": true

pressing `Ctrl+Shift+ to open a new terminal will activate the virtual environment automatically.

Upvotes: 0

Divyessh
Divyessh

Reputation: 2721

Use the following:

.\ll_env\Scripts\activate

Upvotes: 2

Related Questions