cannot use pip to install packages in virtual env for Python in VSCODE

26 views Asked by At

I am trying to set up a virtual environment for python in VSCODE, here is my command to create virtual env:

python3 -m venv .venv 

and use this command to activate the virtual env:

source .venv/bin/activate

and tried to use pip to install packages in the virtual env but the packages installed in the local python path, I use which pipto check whether pip is in the virtual env and it's actually in the virtual env:

/xxxxxx/venv/bin/pip

but when I use this command to install packages:

pip install -r requirements.txt

got the warning message:

Target directory/xxxxxxxxx (the local python route) already exists. Specify --upgrade to force replacement

and the installed packages are not shown in my virtual env, can you please help me to figure it out? Many Thanks!

0

There are 0 answers