Download it from "http://ftp.gnu.org/gnu/emacs/windows/ and install it.
ELPY is an Emacs package which provides Python's commands completion, indentation highlighting, snippet expansion, code hinting, code navigation, code refactoring, on-the-fly checks, virtualenv support and test running. Original documentation: https://elpy.readthedocs.io/en/latest/introduction.html#installation. Another interesting (and very comprehensive) resource is: https://realpython.com/emacs-the-best-python-editor/.
If you are using a Python enviroment, the shell PATH
variable must include the "binary" files installed by pip
. For example, if you are using pyenv, add
export PATH=/home/vruiz/.pyenv/versions/3.6.4/bin/:$PATH
to your shell configuration file (~/.bashrc
, for example).
In Emacs, run <Esc> x package-install <Enter> elpy <Enter>
. Enable this package by including
(package-initialize)
(elpy-enable)
into your ~/.emacs
Emacs configuration file. Restart Emacs.
In Emacs, key-in:
<Esc> x elpy-config <Enter>
Elpy will check the Elpy-related Python packages which are available and will display a summary. At this moment, the following packages should be missing (and therefore, installed). After that, Emacs need to be reset (closed and open):
pip install jedi
pip install rope
pip install importmagic
pip install autopep8
pip install yapf
pip install flake8
Run emacs
and, type <Esc> x package-install <Enter> better-defaults <Enter>
. Remember that autocompletation is always available! Install also material-theme
. To enable these themes, add:
(setq inhibit-startup-message t) ;; hide the startup message
(load-theme 'material t) ;; load material theme
(global-linum-mode t) ;; enable line numbers globally
to your configuration file, and restart Emacs.
Add this code to the Emacs configuration file: $HOME/.emacs
:
;; Standard package.el + MELPA setup
;; (See also: https://github.com/milkypostman/melpa#usage)
(require 'package)
(add-to-list 'package-archives
'("melpa" . "http://melpa.milkbox.net/packages/") t)
(package-initialize)
;; Standard Jedi.el setting
(add-hook 'python-mode-hook 'jedi:setup)
(setq jedi:complete-on-dot t)
;; Type:
;; M-x package-install RET jedi RET
;; M-x jedi:install-server RET
;; Then open Python file.
In the shell:
sudo apt-get install virtualenv
# pip install epc # ... sometimes
In emacs:
M-x package-install RET jedi RET
M-x jedi:install-server RET