Should I activate venv in VS code terminal then PIP install, or as long as bottom left shows venv I am good to go?

Viewed 1362

When the bottom left of VScode shows the venv python after selecting the venv python as the interpreter: - Should I still activate the venv in VScode terminal to PIP install?

Or, since the venv python shows up in the bottom left: - Can I just go straight to PIP installing a package?

Just getting used to VS code, maybe just not understanding the layout.

Thank You

2 Answers

One neat way to check this is to type in pip --version from within the VSCode terminal. This will return where your active pip directory is, and you should find that it will point back to the virtual environment path.

So to answer your question about whether you need to activate the venv in VScode terminal to use pip: you shouldn't need to. When you pop open a new terminal (for me, it's Powershell), it will automatically activate the venv. You can also see this by looking at the start of the command line, where the name of your venv will be in parantheses.

Don't forget to close out an existing terminal and reopen a new one if you started the venv after a terminal was already open in VSCode.

Related