Django does not install in virtualenv

I am using Linux (Lubuntu) and installed virtualenv this way

sudo easy_install virtualenv

and then did

mkdir virt_env

and created the folder in which the virtual disk is stored. Then i did

virtualenv virt_env/virt1 --no-site-packages

and created the environment. Then I activated it like this:

source virt_env/virt1/bin/activate

and everything went well. Then i did

sudo pip install Django

and he said that he was successfully installed. Then i did

pip freeze

and Django is not specified. I disabled virtualenv and did

pip freeze

and Django was there. Why did he install Django all over the country and not in virtualenv? Then I activated virtualenv again and tried

sudo pip install Django

and he said

Requirement already satisfied (use --upgrade to upgrade): Django in /usr/local/lib/python2.7/dist-packages

how do i install it in virtualenv and not in the system?

+3
source share
1 answer

cd'ing virt1, "bin/pip install django". virt1/bin.

virtualenv (bin, include, lib, local), . "lib" - , virtualenv python virtualenv. bin/pip django, Django lib/python2.x/site-packages/

python, , "bin/pip freeze" "pip freeze".

:

>> mkdir virtualenv_test
>> cd virtualenv_test
>> virutalenv . --no-site-packages
>> source bin/activate
>> bin/pip install django
>> bin/pip freeze
+6

All Articles