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

4 Answers 4

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.

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

1 Comment

That seems a bit inconvenient but it makes sense. Should've tried that before asking, thanks for quick response.
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.

1 Comment

This was the more correct answer. PyDev does not pick up e.g. a MacPorts python install, no matter how much you rescan.
3

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

1 Comment

Made the changes to the interpreter as recommended in other answers and still got errors until I closed the project. Thanks!
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.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.