Posts Tagged ‘pydev unresolved import error’

Eclipse with PyDev

May 2, 2011 1 comment

Update (20121208)
If you want a tuned up Eclipse-Pydev, try Aptana Studio.

For small scripts I use vim or Eric but for a larger project I prefer Eclipse with the PyDev Python plugin.


  • Download Eclipse. You can get the IDE for Java Developers.
  • Add the plugin PyDev using the repository
  • Since the new Ubuntu 11.04 uses Python 2.7 by default, you can tell Eclipse too to use it instead of version 2.6. Go to Window -> Preferences, then Pydev -> Interpreter – Python. Remove Python 2.6 and add Python 2.7.

Now if you want to create a new Python project, choose New -> Pydev Project.


Pydev has lots of cool features. My favorites:

  • code completion (CTRL + Space)
  • Rename (Shift + Alt + R), which works through projects too! Say, you have two projects, A and B. A is a library that is used by B. If you reference A from B correctly then if you rename something in A, PyDev will rename the necessary references in B too. I find it very useful when doing refactoring and trying to find better names for functions/variables.
  • debugger (F11)
  • jump around (hold CTRL and left click with your mouse on a function name to jump to the function’s definition)

Update (20110911)
With PyDev, I get “unresolved import” errors quite often, even if the import is correct and the script runs fine. Here I found some tips how to get rid of them:

  • Click Ctrl + 1 and select “Unresolved import error”. This will hide the error.
  • Under Preferences -> PyDev -> Editor -> Code Analysis, go to the Imports tab. Change Import redefinition from “Error” to “Warning”. I don’t recommend “Ignore” because it will hide the real errors too.

For more tips, refer to this post.