How do I activate my virtual environment in Windows?

帅比萌擦擦* 提交于 2021-01-29 10:50:48

问题


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.


回答1:


Use the following:

.\ll_env\Scripts\activate



回答2:


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

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.




回答3:


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

cd Scripts
activate


来源:https://stackoverflow.com/questions/64439019/how-do-i-activate-my-virtual-environment-in-windows

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!