4

I'm trying to setup Django with Eclipse. Right now I'm creating a new Pydev Django project, and getting "Django not found" error message.

When I try to verify Django is integrated via the command line, it works.

>>> import django
>>> print django.get_version()
1.2.5

I have exactly two python installations, 2.7 and 3.2, and I'm sure I'm using 2.7 from Eclipse (and the command line). What am I doing wrong?

2
  • have you added interpreters? Window > Preferences > PyDev > Interpreter *; Commented Feb 21, 2011 at 13:20
  • @JackLeo - Yes I have, I added the correct interpreters. Commented Feb 21, 2011 at 15:39

2 Answers 2

12

If you added the python interpreter before installing django, you can get this error message. Remove the python interpreter from eclipse and add it again. Eclipse will do some caching/searching of some sort. This solved my same problem.

Sign up to request clarification or add additional context in comments.

1 Comment

I had the same problem, have spent a few hours looking at various solutions. At first the above did not work but once I restarted Eclipse it worked like a charm. Thanks
2

In my case I use virtualenv and a custom local version of easy_install to avoid needing to be root. I have Django installed in ~/.local/lib/python2.7/site-packages/. I added this path in Eclipse in the PyDev interpreter.

However, this did not fix the problem. It turned out that I needed to explicitly add the Django directory as well (ie: ~/.local/lib/python2.7/site-packages/Django-1.6.2-py2.7.egg/).

So remember to explicitly select the Django directory in PyDev interpreter especially if you have stuff customized in some fashion.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.