Eclipse with PyDev
If you want a tuned up Eclipse-Pydev, try Aptana Studio.
- Download Eclipse. You can get the IDE for Java Developers.
- Add the plugin PyDev using the repository http://pydev.org/updates.
- 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)
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.