简体   繁体   中英

Why isn't my virtualenv opening up in visual studio code?

I'm working with Django right now and when I installed it through the command prompt I made a virtualenv called test, now I went into vs code and I am trying to open it up by saying workon test but it's not going into the virutalenv. I am on windows and I am using visual studio code.

To open virtual env through command prompt,

run, activate.bat

\test\Scripts\activate.bat

for bash run,

source test/bin/activate

just go to the left below corner where your python version is written click it, it will open the command palette where select the virtual env. (with its name) that's is test and press ok. After that open new terminal and you will get what you want

In cmd typing test/Scripts/activate worked, but in vscode terminal, I had to cd till the Scripts and then type .\activate .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM