Setting up Emacs24 for python development
Question: I want to configure Emacs24 for python development. So far I've fallowed the
instructions in [this blog post](http://www.yilmazhuseyin.com/blog/dev/emacs-
setup-python-development/) and done all the steps successfully, but nothing
happened when I reopened Emacs. It's maybe because the blog post is a little
out of date (May 2011) and it has been tested on Emacs23. does anybody have
any better instructions? preferably tested recently on Emacs24.

What I need most is auto-complete for python (version >3), and django after
that.

By the way I'm using LinuxMint14 if it is any important.


Answer: It's probably best to install things from one of the repositories. `pymacs`
and `pyflakes` are both in MELPA. This repo also has the `flymake-python-
pyflakes` \- which is kind of an extension of the snippet in the blog post.

You will probably have very little use for `ropemacs` at first because that's
not intended for Python development proper, it's for extending Emacs with
Python (rather than Emacs Lisp).

So, I'd say, first add this:

    
    
    (add-to-list 'package-archives
        '("melpa" . "http://melpa.milkbox.net/packages/") t)
    (add-to-list 'package-archives 
        '("marmalade" . "http://marmalade-repo.org/packages/"))
    (package-initialize)
    

to your Emacs init file (usually `~/.emacs`), evaluate it with `M-x``eval-
buffer`. Then `M-x``list-packages`, search for Pymacs, pyflakes, auto-complete
and whatever you like. Pressing `RET` on package name will open a buffer with
package description. Pressing `i` on package name will schedule it for
installation, pressing `x` will install all packages scheduled for
installation.

Also note that ropes is a Python library needed for many code-related tasks in
various editors. So you'd need to install that too, sooner or later. Usually,
if you have Python installed, you'd already have `pip` program, so I'd suggest
you do:

    
    
    $ pip install rope ropemacs
    

It will be probably:

    
    
    $ pip3 install rope_py3k
    

(I'm guessing from the package name).

Rather than installing it by hand. If `pip` isn't installed by default:

    
    
    $ sudo apt-get install pip
    

(it could be also named `python-pip`, at least this is the name on RHEL
distros). Also on RHEL there are two different versions, `python-pip` and
`python-pip3`, the other one being for Python 3.X I believe, so install
whichever is appropriate.

The benefit of using an installer of this kind is that it will do all the
maintenance job in the way that others can anticipate, and so would be able to
help if need be.

There are also lots of Python-related bits of Emacs Lisp code floating around.
I'd suggest you check out <https://github.com/jorgenschaefer/elpy/wiki>
(installable through MELPA). MELPA also lists PyDE support:
<http://pyde.bitbucket.org/> but I don't know what it is.

