Hira Tanveer
Hira Tanveer

Reputation: 375

(venv) (base) both active on a python project, how do I get into venv only?

So I am using vscode with conda (for a django project), and trying to activate my virtual environment named "venv". And it goes from:

(base) C:\Users\User\Desktop\pfa-master\pfa-master\venv\Scripts> .\activate

to something like this:

(venv) (base) C:\Users\User\Desktop\pfa-master\pfa-master\venv\Scripts>

And if I try to find out Python version, it shows error like this:

(venv) (base) C:\Users\User\Desktop\pfa-master\pfa-master>which python
'which' is not recognized as an internal or external command,
operable program or batch file.

Note: I have Python in environment variables for anaconda.

What am I doing wrong?

Upvotes: 13

Views: 18898

Answers (6)

noestl
noestl

Reputation: 81

You have two virtual environments active.

conda and virtualenv are both package manager and environment management system :

If you want to use (venv) only, you need to deactivate conda : conda deactivate

If you want to use (base) only, you need to delete the venv directory from your repository : sudo rm -rf venv. Command differs because you are using Windows.

Upvotes: 7

user17011931
user17011931

Reputation: 11

first you can use activate to activate venv, and then use conda deactivate to deactivate (base).

Upvotes: 1

ms1234
ms1234

Reputation: 121

You need to deactivate Conda. In terminal, conda deactivate should get rid of (base). When you want to reactivate Conda, conda activate.

Upvotes: 12

Max
Max

Reputation: 1

Try this command:

python --version

Upvotes: -1

mango orange
mango orange

Reputation: 108

if you have anaconda in your environmental PATH, try activate venv. Also, try restarting VScode sometimes it glitches.

Upvotes: 0

Nico Bleiler
Nico Bleiler

Reputation: 493

Use the command python -V to find the installed python version and pip -V to get the current pip version.

Upvotes: 0

Related Questions