Activating a virtual env not working

When changing the environment location we must execute virtualenv on the new folder. When looking to activate file I have found this code :

VIRTUAL_ENV="/old/folder"
export VIRTUAL_ENV

This variable will updated when we execute virtualenv on the new folder.


Lets say you have got two virtual environments installed venv1 and venv2.

virtualenv venv1
virtualenv venv2

Virtualenv will create the directories and install the relevant Python libraries, PIP, etc.

Activate each environment one at a time.do your stuff and deactivate.

source venv1/bin/activate    
# make changes to the environment. i.e pip install django==1.6.8
deactivate

source venv2/bin/activate   
# make changes to the environment. i.e pip install django==1.7.1
deactivate

can check installed django versions.

source venv1/bin/activate
python
import django
django.VERSION
[. . . . make note of the version of django running . . . .]
deactivate

source venv2/bin/activate
python
import django
django.VERSION
[. . . . make note of the version of django running . . . .]
deactivate

If everything was done correctly you should see a different version of Django running in each virtualenv.