Skip to content Skip to sidebar Skip to footer

Activating A Virtual Env Not Working

I created two virtualenv and I installed two different versions of django. Now I have a problem to activate the two environment, I do like this : source Django1.6/bin/activate The

Solution 1:

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.

Solution 2:

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.

Post a Comment for "Activating A Virtual Env Not Working"