How to install Jedi Python auto-complete for Emacs

如何为Emacs安装Jedi Python 自动补行包

(Jedi的主要功能:Auto-completion and popup help)

1. install virtualenv package

sudo pip install virtualenv

2. set Emacs inititing configuration as following

touch ~/.emacs.d/init.el

past in file following lines:

(require 'package) ;; You might already have this line
(add-to-list 'package-archives
'("melpa" . "https://melpa.org/packages/" ))
(when (< emacs-major-version 24)
;; For important compatibility libraries like cl-lib
(add-to-list 'package-archives '("gnu" . "http://elpa.gnu.org/packages/" )))
(package-initialize) ;; You might already have this line

(add-hook 'python-mode-hook 'jedi:setup)
(setq jedi:complete-on-dot t) ; optiona

3. start Emacs, and install the Jide

M-x package-install RET jedi RET

or

M-x list-packages

Then select and install

jedi-core
jedi-direx

4. Finally, install Python-EPC server in Emacs 

M-x jedi:install-server