28

I'm using Django and PyDev/Eclipse. I just installed django-treebeard with setup.py install and it got installed in my site-packages directory C:\Python26\Lib\site-packages. I can successfully import it in the python shell with import treebeard. However PyDev complains that it cannot resolve it when I try to import it.

Unfortunately I have no experience with PyDev and I assumed that it would automatically pick up everything in the site-packages directory but apparently it does not. What am I missing?

thanks

Raoul Duke
  • 4,241
  • 2
  • 23
  • 18

4 Answers4

37

Pydev doesn't automatically rescan the site-packages folder. You need to go to Preferences-> Interpreter -> Python and click apply to make it scan again.

Jochen Ritzel
  • 104,512
  • 31
  • 200
  • 194
  • 1
    That seems a bit inconvenient but it makes sense. Should've tried that before asking, thanks for quick response. – Raoul Duke Aug 31 '10 at 15:11
14

I also faced the same error when i had installed a new package.i'm using eclipse Helios. Even after applying and re scanning the folder it was NOT detecting the new packages. So finally i clicked on the "Click here to configure a interpreter not listed" listed and deleted the already selected interpreter and used the autoconfig to add the interpreter again. Finally i was able to resolve the issue.

Jay
  • 149
  • 1
  • 2
  • 2
    This was the more correct answer. PyDev does not pick up e.g. a MacPorts python install, no matter how much you rescan. – smci Sep 09 '11 at 03:20
3

I've found that closing the project and reopening (after rescanning the interpreter) works for me.

powlo
  • 2,538
  • 3
  • 28
  • 38
  • Made the changes to the interpreter as recommended in other answers and still got errors until I closed the project. Thanks! – Fuzzy Analysis Feb 14 '13 at 10:49
0

Well, I followed this sequence to make it work:

1) I installed the desired library by using pip install 2) I went in Eclipse to: Window --> Preferences --> Pydev --> Interpreters --> Python Interpreter, and clicked "Quick Auto-Config". It made the trick.

lfvv
  • 1,509
  • 15
  • 17