2

related to: Unresolved Import Issues with PyDev and Eclipse

Recently I moved my django package to django_trunk so I can have a development version elsewhere. I have no issue importing django, runserver, or any of that.

My issue (annoyance?) is that all of the imports are coming up as underscored red indicating an error.

Pydev clearly knows of the imports, but for whatever reason it still imports as red.

I've noticed this with a few other packages, which use a .pth file instead of a direct import. In the past I've just ignored the red, but with django it's half my screen and I'm loosing critical information.

To demonstrate:

import django #note that django is underscored as red
import sys

print django
print sys.path

module 'django' from 'C:\Python27\Lib\site-packages\django_trunk\django__init__.pyc' [...,'C:\Python27\Lib\site-packages\django_trunk', ...]

Community
  • 1
  • 1
James R
  • 4,571
  • 3
  • 30
  • 45
  • Did you try re-configuring the Interpreter by going to Window -> Preferences -> PyDev -> Interpreter-Python and removing and adding the Python interpreters again? I had a similar issue a while back and I remember it was fixed by reconfiguring the interpreter. – Praveen Gollakota Feb 08 '12 at 15:50
  • that worked. you should put that as the answer, so i can select it as answered. Thank you – James R Feb 08 '12 at 16:01
  • Nice! :) I added it as an answer. – Praveen Gollakota Feb 08 '12 at 16:33

1 Answers1

3

Try reconfiguring the Interpreter by going to Window -> Preferences -> PyDev -> Interpreter-Python and removing and adding the Python interpreters again.

Praveen Gollakota
  • 37,112
  • 11
  • 62
  • 61