Using Emacs as a Python IDE

If you follow the Emacs scene, one of the questions you see all the time is how to configure Emacs as a Python IDE. Emacs, of course, offers rudimentary support for Python but that consists mostly of syntax highlighting and indentation. Fortunately, there’s elpy, an Emacs package that brings a more complete Python IDE to Emacs.

Sean Wade Jon Fincher has a nice post that serves as a mini-tutorial on how to install and configure Emacs and elpy to provide an excellent Python development environment. He begins with a short introduction that links to Xah Lee’s instructions for installing Emacs and covers just a little bit about how to use Emacs. He recommends doing Emacs’s built-in tutorial to learn the basics.

After the introduction, Wade walks you through making a minimum configuration. Experienced Emacsers may or may not like his configuration but it is an appropriate for a N00bs who can tweak things to their liking when they get a little more experience.

The meat of the post discusses how to install and use elpy. Read the post for the details but it doesn’t seem very complicated. Then Wade talks about adding things like flycheck, the black code reformatter, integration with Jupyter Notebooks, and, finally, Ipython.

Wade concludes the tutorial with a discussion of support for testing, debugging, and version control. The result is a very nice Python IDE built into Emacs. That can be important because, as Wade says, the average developer will be writing in several computer languages, perhaps using a markup language like Markdown or Org, writing Shell scripts, and probably many other editing chores. That developer can be much more efficient if he uses and masters a single editor for all those tasks rather than depending on bespoke editors for each language or chore.

Even if you use Python only occasionally, it’s worthwhile having a REPL and proper language support so Wade’s post is definitely worth your while.

UPDATE [2020-04-06 Mon 13:53]: Added link to Wade’s post.

UPDATE 2 [2020-04-14 Tue 13:28]: Sacha wrote to say that Wade’s article appears to be a reposting of one by Jon Fincher. A bit later Dan Bader wrote that Sacha is correct and that apparently the site (morioh) is making a habit of such things. If you follow the link that Sacha and Bader provide, you can see that it is, in fact, the same post. How is this right or even legal?

UPDATE 3 [2020-04-14 Tue 15:10]: I’ve removed the link to Wade’s post so as not to reward bad behavior with a link. The post itself is well worth reading so go read Fincher’s original.

This entry was posted in General and tagged . Bookmark the permalink.