Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Installing a package in Python virtualenv still causes it to be installed globally

I installed virtualenv and created a virtual environment called ENV1.

Then I activated the environment by running 'source bin/activate'. I am sure the virtual environment is activated because the command prompt has changed, reflecting the new environment.

Then from that command prompt, I ran 'pip install lpthw.web'. I would have thought this package will get installed somewhere in the ENV1 directory, but instead it got installed in /usr/local/lib/python2.6/dist-packages/

Is this the correct behavior? Could someone please point out if I am doing something wrong.

like image 483
Parag Avatar asked Feb 26 '26 00:02

Parag


1 Answers

Check which pip you are actually running (which pip), also try running pip -E path-to-your-env install ....

like image 68
abbot Avatar answered Feb 27 '26 17:02

abbot



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!