share
Stack OverflowIs there an IDE that provides code completion for Python?
[+129] [51] Justin Walgran
[2008-08-03 14:22:28]
[ python ide code-completion wing-ide ]
[ http://stackoverflow.com/questions/698/is-there-an-ide-that-provides-code-completion-for-python ] [DELETED]

I find that I only type 2 to 4 characters of any given keyword which drastically speeds up my coding.
Now that I have been spending time writing some Python code I find myself reaching for ctrl+space.

Are there any IDEs that support code completion in Python?
I do my python development on a Mac. So, an OS x tool would be preferable.
It seems like the doc string property of Python methods is a perfect match for inline API discovery.

(15) stackoverflow.com/questions/81584/what-ide-to-use-for-python Has an entire breakdown of virtually every python IDE. - ahawker
Its not and IDE, but I think the plugin vim jedi is even better. - jdg
[+69] [2008-08-03 15:03:24] Seb

Actually, PyDev plugin for Eclipse has a full support for code completion (try PyDev Extensions too). You can easily try it here [1]. Another editor worth mentioning is WingIDE [2], which is really powerful. For more on Python editors check this page [3].

I use Aquamacs [4] with ropemacs [5] on my Mac, but that's an ultra geeky setup :)

[1] http://easyeclipse.org/site/distributions/python.html
[2] http://www.wingware.com/
[3] http://wiki.python.org/moin/PythonEditors
[4] http://aquamacs.org/
[5] http://rope.sourceforge.net/ropemacs.html

EasyEclipse for Python is the best choice for me from references in this ansfer. - krzych
PyDev plugin for Eclipse rocks. - RoboAlex
1
[+36] [2008-08-03 14:30:02] Leon Bambrick

The free Komodo Edit [1] app from ActiveState includes code completion.

It's provided via XML files that detail the API(s) you are using.

It is cross platform and thus works on Windows, Linux and Mac.

[1] http://www.activestate.com/komodo%5Fedit/

(2) Sadly if you're used to intellisense, Komodo's code completion can only be described as "not really present". Python's dynamic typing makes proper code completion a really really hard problem. - Timmmm
2
[+33] [2008-08-07 17:55:32] codemac

Vim's OmniComplete has the same fun intellitext-style popups and everything for auto completion.

Vim: Omni completion [1]

As a further development of VIM's builtin pythoncomplete, jedi-vim [2] really understands your Python code (like decorators, list comprehensions, etc). It's using the Jedi [3] library.

[1] http://vimdoc.sourceforge.net/htmldoc/version7.html#new-omni-completion
[2] https://github.com/davidhalter/jedi-vim
[3] https://github.com/davidhalter/jedi

+1. jedi-vim is very nice indeed. Many thanks. - Sardathrion
3
[+23] [2008-08-08 19:48:49] JSN

I have tried a lot of python IDE's and the best one I like is PyScripter [1]. Its easy to use and has nice code completion.

[1] http://code.google.com/p/pyscripter/

(2) It's for Windows only, and is written in Delphi. For me, a Delphi guy, that last one is a great Positive. For anybody not on Windows, however, it's a deal breaker. - Warren P
+1 to this, get the x64 if you are on Windows 7 - fedmich
4
[+23] [2010-05-09 05:55:40] adamJLev

Pycharm: http://www.jetbrains.com/pycharm/

Works pretty great for me. Of course code completion in python is not going to be as perfect as it is for static languages -- a variable can dynamically change at runtime into anything. But it beats the hell out of nothing.

Also if you set up your interpreter and site-packages paths correctly in the project settings, you can easily jump into the definition of a Python's library module py files, which is very helpful at times. Plus the completion helper reads functions docstrings.

alt text

http://imgur.com/wIvAt.png


+1 as well, note though that this not FREE. jetbrains.com/pycharm/buy/index.jsp consider buying it after using the trial - fedmich
(1) Love the features but it's so slow & bulky, I don't use it despite having a license. Something light & slick like Sublime Text is way more fun to work with. - buffer
@fedmich There is now a free version: jetbrains.com/pycharm/download - edhedges
5
[+22] [2008-08-24 11:45:35] Mike Mazur

It's also possible to turn VIM into a respectable Python IDE:

Turning Vim into a modern Python IDE [1]

[1] http://sontek.net/blog/detail/turning-vim-into-a-modern-python-ide

+1 thanks for this - Justin
I have tried that and gave up, I do like the vi shortcuts (and use viemu in VS) but getting it started and working correctly is a pain in the ass. Now I use Aptana which is quite nice and has good code completion ( but still not Intellisense level). - Ziv
Dead link again - Adam Parkin
Looks like both of the links are dead again. - Gemini14
6
[+14] [2008-11-01 17:04:28] orestis

I've written PySmell, a library that provides auto-completion to Emacs, Vim and TextMate, by taking the TAGS approach - generate tags for your code and other projects, and complete based on those.

It completes import statetements, and has some rudimentary type inferencing. I'm about to release v0.7 which supports all that.

Grab it from: http://code.google.com/p/pysmell/


This library doesn't seem to have had any active development since 2009, sadly. I would suggest reading the sontek.net article linked to in @MikeMazur's answer instead. - alldayremix
7
[+10] [2008-09-20 09:51:17] vog

IPython [1] is an almost complete interactive python shell with an integrated help system and tab completion for every live object and class.

So you just need an IDE that integrates well with IPython, such as PIDA [2] or Emacs [3].

[1] http://ipython.org/
[2] http://pida.co.uk/
[3] http://www.gnu.org/software/emacs/

It doesn't work with Python 3. - riza
(1) The author didn't ask explicitly for Python3. In addition, when Python3 becomes mature, IPython will surely also work on Python3. - vog
8
[+8] [2008-08-10 11:43:32] ChrisThomas123

Komodo Edit [1] from the Open Komodo [2] project has the best auto-completion and code/text introspection I've ever seen on an editor - for python as well as a number of languages. It reads from your source, rather than requiring any particular configuration. (It even manages to be able to edit Bash, SQL and structured text files intelligently.) You can also attach libraries/modules to it, so you have documented access to them.

I would highly recommend the free Komodo edit.

[1] http://www.activestate.com/komodo%5Fedit/
[2] http://www.openkomodo.com/

9
[+7] [2008-08-23 16:27:50] ars

On Windows, PyScripter [1] is a pretty good free and open-source IDE that provides code completion (as well as debugging and other features). It doesn't really parse doc strings or other annotations, so it has limits to the completions that can be offered.

WingIDE [2] is a cross-platform (Windows, Linux, Mac) commercial IDE. It's pretty full featured and you can provide annotations in comments as hints to the intellisense. There's a free version of Wing, but I don't know if that contains that feature. A trial version is available for all the versions.

[1] http://code.google.com/p/pyscripter/
[2] http://wingware.com/

+1 because I Like PyScripter. It does understand doc strings, but only when you are debugging a Python script. It would be nice if the Code Explorer window understood doc strings. - Ashley Davis
10
[+6] [2008-08-25 17:34:33] Zameer Manji

I'm surprised no one has mentioned SPE ( pythonide.blogspot.com [1]). It has code completion not only with the python libraries but the code you write as well, it's not import only it will complete code in the same file as well. It also has a whole bunch of features like UML diagram tool, and pydoc generation.

[1] http://pythonide.blogspot.com/

Of course since Stani made the move to Ubuntu, the deployment to windows isn't trivial (import from public svn, etc). A great editor though. - Christopher Mahan
Added a link for SPE on windows: pythonide.blogspot.com/2007/02/… - Christopher Mahan
SPE on sf.net is version 0.8.3 (2006). On SVN: version 0.8.4.i. (August 2008) - Christopher Mahan
11
[+6] [2008-09-16 11:28:51] Brutus

I ditched all of the below and only use Sublime Text [1] nowadays. It's really great, and has awesome Python support trough add-ons (and good support out of the box).

Here are some that I use frequently:


Eclipse [5] (with pyDev [6]) is great. Personally I find it a bit overkill for mundane tasks. The more features, the more they distract you from getting things done. Vim [7] is my standard choice, it's powerful but the interface don't get in your way (check :help python in Vim). There's also a nice Tutorial [8] on using Python with Vim.

Both are Open Source and got great Communities to get help.

But on Mac I would strongly suggest to check out TextMate [9], it's awesome (and got nice support for Python and Django). I use it at work and absolutely love it, it's powerful but not bloated and let you focus an your work. TextMate [10] is not Open Source though (if you care), and OS X only, so I stick to Linux and Vim at home.

Another slick and casual editor for Linux would be Scribes [11]. For those on Linux who find an IDE too bloated but Vim too complex, check it out, it is very minimalistic but got some nice features gEdit, Kate, etc. miss.

[1] http://www.sublimetext.com/
[2] https://sublime.wbond.net/packages/Python%20Checker
[3] https://sublime.wbond.net/packages/Jedi%20-%20Python%20autocompletion
[4] https://sublime.wbond.net/search/python
[5] http://www.eclipse.org/
[6] http://pydev.sourceforge.net/
[7] http://www.vim.org/
[8] http://blog.sontek.net/2008/05/11/python-with-a-modular-ide-vim/
[9] http://macromates.com/
[10] http://macromates.com/
[11] http://scribes.sourceforge.net/

12
[+5] [2008-08-03 14:57:35] James Sulak

I've found that Eclipse/PyDev's autocomplete feature more powerful than Komodo Edit's, but that's to be expected. Although I'm a big autocomplete fan, I still find myself using Komodo more because it does a much better job of staying out of your way when you just want to write a script.


13
[+5] [2008-08-04 10:49:14] Xetius

There is a full Komodo IDE [1] from ActiveState which will allow you to debug and step through Python code as well as do the code completion. I use it at work for Perl and PHP development (it covers Perl, Python, Ruby, TCL and PHP) and it works really well. I use it on a PC, but I know it works for Macs as well. Of course, this one you have to pay for over the free Komodo Edit [2], but you do get a lot [3] for your money.

[1] http://www.activestate.com/komodo/
[2] http://www.activestate.com/komodo%5Fedit
[3] http://www.activestate.com/komodo%5Fedit/comparison/

14
[+3] [2008-08-03 15:55:54] Justin Walgran

To be really worthwhile the autocomple should read from your source, not just an API listing. It sounds like both Komodo and the Eclipse plugin do not support that. Is there any option that does?


In Emacs, the dabbrev-expand command expands words "dynamically". The command is bound to M-/ (Alt-slash in Linux). Type C-h k M-/ in Emacs for more information. - akaihola
15
[+3] [2008-08-15 16:13:59] David Locke

I'm not sure how well this would transfer to a Mac, but adding auto completion is easy in linux.

In your .pystartup.py file, add the following lines.

import readline
readline.parse_and_bind("tab: complete")
del readline

That's the python command line, which is useful, but nothing like an ide. - rjmunro
16
[+3] [2008-08-17 16:38:35] Arkady

WingIDE (www.wingware.com) is by far superior in terms of code completion and being "Python-aware" in general to any Python editor or IDE out there (I've looked at PyDev, Komodo, and others mentioned here). WingIDE is not free, but being under $200 for a full-blown single-user version makes it easy to talk even the cheapest manager into the purchase. Take it for a free trial first and experiment with all the options. I've used it for about 3 years now and would not think of writing/debugging Python code without it.


17
[+2] [2008-08-03 22:19:02] Dan

I use TextMate [1] on my Macintosh. With the Python/Django bundles it's very usable (and mac-like, which is important to me... emacs/aquamacs/xemacs make me context-switch from the rest of my applications).

[1] http://macromates.com/

18
[+2] [2008-08-11 14:08:28] Bartosz Radaczyński

Actually PyDev [1] is worth while and I've found it to be the best of all the editors for Python. It seems though, that Pydev extensions [2] (which are nonfree) would make the perfect couple. Too bad that these aren't free (autoimport and other stuff from PyDev extensions are really nice).

Two other editors I've been using with python so far are Eric [3] and UliPad [4](mostly on slower computers). Vim [5] is also great, but I couldn't get it to autocomplete on Windows somehow :-(

[1] http://pydev.sourceforge.net/
[2] http://www.fabioz.com/pydev/
[3] http://die-offenbachs.de/eric/
[4] http://code.google.com/p/ulipad/
[5] http://www.vim.org/

(1) Just ran into this, and I'd like to add (for completion) that PyDev Extensions has since become free and open source as well. It can be found here: pydev.org/index.html - Edan Maor
19
[+2] [2008-09-10 07:14:57] ibz

Emacs and vim both have autocomplete.


20
[+2] [2008-09-25 18:47:41] jimmyorr

The rlcompleter module deserves special mention here. It's not specific to an IDE, but it does provide tab code completion in Python's interactive mode...very handy.

https://docs.python.org/library/rlcompleter.html


21
[+1] [2008-08-03 14:33:00] Gareth Simpson

Eclipse will do it, but only for imported objects. Sadly not for objects in your own source.


22
[+1] [2008-08-03 14:37:45] saalon

@Leon Yes, Komodo Edit is available for the Mac as well as for Windows. In fact, I use it on both platforms, and I'm extremely happy with it.

One thing to keep in mind: it's not a full blown IDE. It's more of a text editor with some project features and good syntax highlighting and code completion. If you're looking for something as beefy as Eclipse or Visual Studio, Komodo Edit may seem a little stripped down. On the other hand, Komodo is really, really easy to find your way around and doesn't have nearly the mental overhead of learning a new IDE like Eclipse.

I personally love Komodo Edit and recommend giving it a whirl.

Eric Sipple

edit: One other thing about Komodo Edit if you're used to Visual Studio (like I was when I started using it). Its code completion requires you hit Enter/Return to finish what you're writing, unlike Visual Studio. I find myself hitting the wrong key for the first couple of lines of code if I fire up Komodo after getting home from work.


23
[+1] [2008-08-03 16:37:03] Daan

Here you can find a complete list of editors for Python:

PythonEditors [1]

For me, the best editor is PyDev in Eclipse. Especially the debugging is nice.

[1] http://wiki.python.org/moin/PythonEditors

24
[+1] [2008-08-05 15:55:37] PabloG

Boa Constructor [1] is free, OpenSource and developed in Python + wxPython. It supports auto completion pressing Ctrl+Space, works OK for me.

[1] http://boa-constructor.sourceforge.net/

25
[+1] [2008-08-06 10:03:23] Nidonocu

Not an OSX editor, but for those working with IronPython on Windows, there is a community maintained edition of Visual Studio available configured for working with IronPython and providing full Windows Forms and WPF designer support.

It can be accessed from its home on CodePlex [1].

[1] http://www.codeplex.com/IronPythonStudio

26
[+1] [2008-08-06 20:40:46] Ghirai

eric4 does the job very well for me: http://eric-ide.python-projects.org/


27
[+1] [2008-08-08 17:12:02] amit

pydev plugin for Eclipse is the best option for now !! Also since it is an open source project you can extend it if you didnt like any feature


28
[+1] [2008-08-20 02:45:33] Petey

The best editor for the Mac IMO is TextMate [1]. It's got a python bundle that will do what you're looking for. It's got bundles for a zillion other languages as well.

Well worth the price.

[1] http://macromates.com

29
[+1] [2008-08-29 18:51:39] joel.neely

I have heard (disclaimer: I have no personal experience with it) that the Python editing for NetBeans, done to support Jython, has nice code completion and other features.

Here's a link to a relevant post on multi-lingual NetBeans [1] by Tor Norbye, a NetBeans wizard.

[1] http://blogs.oracle.com/tor/entry/multilingual_netbeans

I don't think its fully baked yet, but the Ruby support (which Tor also helped on) does have code completion for your code, as well as other libraries, so I'd assume the Python support would too. - Andrew Harmel-Law
30
[+1] [2008-09-18 03:46:49] emb

Try Eric IDE [1] I quite enjoyed using it.. am back to vim though.

[1] http://www.die-offenbachs.de/eric/index.html

31
[+1] [2008-09-18 04:17:46] sontek

I've wrote a very detailed blog on how to use vim and python together. This includes code completion, debugging, and context sensitive help.

You can get it here: http://blog.sontek.net/2008/05/11/python-with-a-modular-ide-vim/

Outside of vim, there are other IDE's you can use:

All 3 of those are cross platform and provide debugging and code completion.

Here is a full wiki on IDE's and Python: http://wiki.python.org/moin/IntegratedDevelopmentEnvironments


32
[+1] [2008-09-26 15:16:56] Corey Goldberg

Editra [1] has auto-complete for Python (incidentally it's written in wxPython). It is a nice little multi-platform editor with IDE features:

  • Python auto-indent & code completion
  • Code browser
  • Project browser
  • Source control (SVN, git, ...)

Additionally, the PyStudio plugin offers an integrated debugger and more.

[1] http://editra.org/

33
[+1] [2009-04-14 00:35:14] magcius

For my Python scripting I use emacs + ropemacs [1] (which requires Pymacs [2]) + auto-complete.el [3] + yasnippet [4] along with icicles [5] for minibuffer completion. auto-complete has a bug with ropemacs that stops you from opening a project when using "." for autocompletion, but hopefully this will be fixed soon. In the meantime you can use M-x rope-open-project (which is C-x p o).

[1] http://rope.sourceforge.net/ropemacs.html
[2] http://www.emacswiki.org/emacs/PyMacs
[3] http://www.emacswiki.org/emacs/AutoComplete
[4] http://code.google.com/p/yasnippet/
[5] http://www.emacswiki.org/emacs/Icicles

34
[+1] [2009-04-23 00:32:17] NobodyReally

Ulipad is pretty good.


Really really really good actually. - e-satis
35
[+1] [2009-07-19 06:05:57] João Silva

NetBeans supports it. Check the project here [1].

[1] http://wiki.netbeans.org/Python

36
[0] [2008-08-08 16:52:52] Zod000

The pay version of Komodo IDE [1] has the best autocomplete of any of the IDEs I have personally tried. PyDev's autocomplete is ok, but really don't care of Eclipse unless I am working with Java/J2EE.

[1] http://www.activestate.com/Products/komodo_ide/index.mhtml

37
[0] [2008-08-08 17:55:18] Jason

The free Komodo IDE definitely does parse your own modules/source and include that in the code completion. It is not limited to built in Python APIs.


38
[0] [2008-08-22 14:18:33] Acuminate

TextMate [1] is the best all around editor for any kind of language for the OSX. It doesn't provide intellisense type autocomplete, but does something I find more useful. Type a partial word and hit ESC. It will select the word nearest to where you are typing that matches your start string and input it. Hit ESC again to scroll through more options. There is a Windows clone called e [2].

[1] http://macromates.com
[2] http://www.e-texteditor.com

39
[0] [2008-08-30 20:15:46] Mario Fernandez

@Sebastjan I started using Aquamacs on my Mac for text editing, but I felt like it lost some of the "emacs style". Now I'm using CarbonEmacs, which is older but it looks more like the original :)


40
[0] [2008-09-15 23:13:22] willurd

TextMate [1] is an excellent editor that has a bundle [2] (it's version of plugins) for python development which can be found here [3] in their svn repository. A tutorial on how to add these plugins can be found here [4].

On a side note there are a couple of really nice Django plugins for TextMate as well.

[1] http://macromates.com/
[2] http://manual.macromates.com/en/bundles
[3] http://macromates.com/svn/Bundles/trunk/Bundles/
[4] http://manual.macromates.com/en/bundles#getting_more_bundles

41
[0] [2008-09-20 20:07:06] daniel

I recommend IPython as well. Besides the availability of tab-completion, IPython also supports custom "magic" keywords. My favorite is "%prun" which automatically profiles any method passed. Another benefit is pylab support. Much of my job surrounds the ability to plot data. Starting IPython with pylab turns the interpreter into the Python version of MatLab.


42
[0] [2008-09-21 16:39:14] Rodrigo

There is a plugin available at linil [1] for python code completion using Gedit.

Enjoy it.

[1] http://linil.wordpress.com/2008/05/31/using-gedit-to-auto-complete-python-code/

43
[0] [2009-01-01 17:20:59] marc lincoln

GEdit should do it for youand it makes the plugin creation process very easy and understandable.


44
[0] [2009-01-23 14:10:03] Rodrigo

There is a plugin for python code completion in GEdit available at:

http://linil.wordpress.com/2008/05/31/using-gedit-to-auto-complete-python-code/


45
[0] [2009-02-23 19:50:14] Lakshman Prasad

+1 for Wing Professional IDE.

The "Go To Definition" and "Source Assistant" can really go a long way to assist in your better python learning.

It has Vi and Emacs Emulation too, if U need either of them. Only the UI is bad, if on Windows (as it is based on GTK), It rocks on ubuntu.

If you are using any text editor, (Scite is my choice) then U'd do well by using ipyton console. (U can do a easy_install of ipython, if easy_install is installed)

With python itself providing debug options, and ipython and bash shell offering good auto-complete options, it is not really a that bad option to do away with any IDE. But if you still want an IDE (as I want), Wing Professional is the best one out there.

I have also tried SPE, PyDev and am not impressed enough to consider them; but indeed some features of PyDev like verifying whether a variable is used or not and auto-setting of different modes- Debug, PyDev, Java Browsing when U run and application is available in PyDev alone.

If U only need a good Syntax highlighting SciTE (on windows, SciTE based Notepad++) is a good option. If U need "project" option and auto-complete with Syntax highlighting, Komodo Edit is the best option. It also supports many other languages. If you want everything but the space shuttle (minus some special features of PyDev), Wing Professional is the best IDE currently available.

Most important thing is "Choose one and go with it"


46
[0] [2009-03-06 04:05:40] Peter

YES

Komodo Edit (Win, Linux, Solaris, OSX)

PythonWin (Win)

SPE (Stani's Python Editor)

Wingware's Wing IDE


47
[0] [2009-03-06 04:13:27] TofuBeer

Link to NetBeans [1] support. It is early access, but NetBeans has a good track record on their beta software.

[1] http://wiki.netbeans.org/Python

48
[0] [2009-07-18 23:52:32] infid

For Vim, Pydiction seems to be the only way to go. It can Tab-complete any python module (both system and 3rd party) as well as python keywrods, plus you don't need to have vim support compiled into Vim to use it. http://www.vim.org/scripts/script.php?script_id=850


49
[0] [2009-11-15 20:48:30] Björn

OS X and no one have suggested XCode? XCode is fantastic on the Mac, got used to it when I started with Objective-C. It's a great tool, works great with Python and especially if you're writing Mac OS X software in Cocoa - where PyObjC provides the bindings. This would be my first choice when working in OS X.


50
[-1] [2008-08-11 15:16:11] Chris Marasti-Georg

To be really worthwhile the autocomple should read from your source, not just an API listing. It sounds like both Komodo and the Eclipse plugin do not support that. Is there any option that does?

The free Komodo editor performs its autocompletion on your source, not an API listing. It's what I use for GAE development, the only Python I do.


A lot of people have already said Komodo, this doesn't really say anything new. - someone-or-other
51