Lucas Kauffman
Lucas Kauffman

Reputation: 6891

Eclipse and python not resolving imports

I'm doing some imports with python and sometimes I do not have that package yet, so I install the package.

The problem is when I test it in python's interpreter it resolves the imports :

    Python 2.7.1 (r271:86832, Nov 27 2010, 17:19:03) [MSC v.1500 64 bit (AMD64)] on
win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from termcolor import colored
>>>

However in eclipse I still get errors of unresolved imports, how can I fix this ? Are there any other eclipse like editors out there for python ?

Upvotes: 0

Views: 730

Answers (1)

joaquin
joaquin

Reputation: 85603

Probably you have to reconfigure in Pydev the python interpreter to get the new added libs.

From Pydev tutorial:

If you add something to your python installation, you need to either add it manually as a 'new folder' in the System PYTHONPATH (if it's still not under a folder in the PYTHONPATH) or (recommended) remove your interpreter and add it again, then, press apply.

Note that if you added a library that's already under a folder in the PYTHONPATH, you have to at least go to the interpreter preferences and press apply so that it clears its internal caches (after the configuration is done, things are set in stone for PyDev)

Upvotes: 2

Related Questions