Django not installing in virtualenv

前端 未结 1 1297
轮回少年
轮回少年 2021-01-06 01:15

I am using Linux (Lubuntu) and have installed virtualenv like so

sudo easy_install virtualenv

and then did

mkdir virt_env
<         


        
相关标签:
1条回答
  • 2021-01-06 02:05

    Try cd'ing to the virt1 directory and then running "bin/pip install django". You are using your system wide pip instead of the one in virt1/bin.

    virtualenv creates four directories(bin, include, lib, local) when you initialize it in a directory. "lib" is the directory where virtualenv keeps all your virtualenv specific python packages. Use bin/pip to install django and you will find Django it in lib/python2.x/site-packages/

    When looking for python packages installed in the environment, use "bin/pip freeze" instead of the "pip freeze".

    Steps:

    >> mkdir virtualenv_test
    >> cd virtualenv_test
    >> virutalenv . --no-site-packages
    >> source bin/activate
    >> bin/pip install django
    >> bin/pip freeze
    
    0 讨论(0)
提交回复
热议问题