Debian's Elpy package is configured to use the system-wide Python 3
interpreter and has never shipped with Python 2 support.  See Bug
#927086 for discussion.

To run Elpy's checks for optional dependencies, from within Emacs:
  M-x elpy-enable  ;; <- this is the simplest way to start Elpy.
  M-x elpy-config

To find the corresponding Debian packages, run this in a shell:
  # apt show elpa-elpy | grep 'Recommends\|Suggests'

To autostart Elpy when visiting Python files, add the following
to a user's Emacs config some place after (package-initialize):

  (advice-add 'python-mode :before 'elpy-enable)

Advising python-mode is necessary because elpy-enable must be called
before python-mode, and this is why the following doesn't work:

  (add-hook 'python-mode-hook (lambda () ((elpy-enable))))

The advice-add method avoids the slowdown caused by unconditionally
calling elpy-enable during Emacs init.

Debian-specific customisations are found in elpa-elpy's
debian-autoloads.el file.

  # dpkg -L elpa-elpy | grep debian-autoloads.el

If a virtualenv's python interpreter is not the same as the system
one, then it might be necessary to reenable upstream behaviour.  To do
this, consult debian-autoloads.el, customise 'python-shell-interpreter'
and 'elpy-rpc-python-command' on a per-user basis (eg: ~/.emacs,
~/.emacs.el, or ~/.emacs.d/init.el), and drop the absolute path by
setting these variables to "python3".  Setting them to "python" in the
hopes that this will reenable Python 2 support will not work, because
the Elpy modules needed for Python 2 are neither built nor installed,
and these modules are needed for the RPC Process (see documentation at
Elpy->Concepts->The RPC Process) and various other functions.  Also,
elpa-elpy does not install a number of required Python 2 dependencies.

Elpy's custom PYTHONPATH is not needed, because this package uses
dh-python and has been unset.  Previously Elpy unnecessarily searched
/usr/share/emacs/site-lisp/site-lisp/elpa/elpy-1.23.0 for its
Python modules.

Upstream documentation for the installed Elpy version is available in
info, html, and man page format at the standard locations.  To access
the info page:

  # info elpy
  # or: emacs --eval '(info "elpy")'
  # or from within Emacs: M-x info, C-s elpy

An alternative interactive interpreter can be enabled by setting
'python-shell-interpreter' and 'python-shell-interpreter-args' to
something like Jupyter console or IPython.  See the "Interpreter Setup"
section of Elpy's Documentation for more information.

 -- Nicholas D Steeves <nsteeves@gmail.com>, Sun, 14 Jul 2019 16:55:14 -0400
