[Django]-Django in virtualenv with pydev

2👍

As far as I’m aware you don’t need the django installation (i.e., virtualenv/lib/python2.7/site-packages/django) in your interpreter libraries. Having the site-packages in there (i.e., virtualenv/lib/python2.7/site-packages) should suffice for your interpreter to find any django.* package.

👤chris

2👍

putting this in your interpreter libraries:

virtualenv/lib/python2.7/site-packages/django

wiil not work, because there is no virtualenv/lib/python2.7/site-packages/django/django (yes, twice), this translates to the following:

export PYTHONPATH=<...virtualenv>/lib/python2.7/site-packages/django:$PYTHONPATH
python -c 'import django'

which fails with ImportError message. you need to give the parent directory.

virtualenv/lib/python2.7/site-packages

which translates to the following:

export PYTHONPATH=<...virtualenv>/lib/python2.7/site-packages:$PYTHONPATH
python -c 'import django'

.

👤dnozay

Leave a comment