Search code examples
pythonemacselpy

(elpy-enable) fails with "Symbol's function definition is void: format-message"


I'm trying to try out elpy and have the following lines in my ~/.emacs.d/init.el:

(add-to-list 'package-archives '("elpy" . "http://jorgenschaefer.github.io/packages/"))
(package-initialize)

(defvar my-packages
  '(elpy))
(dolist (p my-packages)
  (when (not (package-installed-p p))
    (package-install p)))

(elpy-enable)

On startup I get the message "Symbol's function definition is void: format-message." Has anyone else run into this issue?


Solution

  • This ended up being an issue with my setup. I had python.el installed as well, which resulted in the following debugger trace:

    Debugger entered--Lisp error: (void-function format-message)
      (format-message "Add `%s' clause? " name)
      (let* ((name (symbol-name name)) (function-name (intern (concat "python-skeleton--" name))) (msg (format-message "Add `%s' clause? " name))) (if (not skel) (progn (setq skel (cons (quote <) (cons (format "%s:" name) (quote (n n > _ n))))))) (cons (quote define-skeleton) (cons function-name (cons (or doc (format "Auxiliary skeleton for %s statement." name)) (cons nil (cons (cons (quote unless) (cons ... ...)) skel))))))
      (closure (python-shell--interpreter-args python-shell--interpreter outline-heading-end-regexp view-return-to-alist t) (name doc &optional &rest skel) "Define a `python-mode' auxiliary skeleton using NAME DOC and SKEL.\nThe skeleton will be bound to python-skeleton-NAME." (let* ((name (symbol-name name)) (function-name (intern (concat "python-skeleton--" name))) (msg (format-message "Add `%s' clause? " name))) (if (not skel) (progn (setq skel (cons (quote <) (cons (format "%s:" name) (quote ...)))))) (cons (quote define-skeleton) (cons function-name (cons (or doc (format "Auxiliary skeleton for %s statement." name)) (cons nil (cons (cons ... ...) skel)))))))(else nil)
      (python-define-auxiliary-skeleton else nil)
      eval-buffer(#<buffer  *load*-95724> nil "/Users/lakshmansankar/.emacs.d/elpa/python-0.25.1/python.el" nil t)  ; Reading at buffer position 170847
      load-with-code-conversion("/Users/lakshmansankar/.emacs.d/elpa/python-0.25.1/python.el" "/Users/lakshmansankar/.emacs.d/elpa/python-0.25.1/python.el" nil t)
      require(python)
      eval-buffer(#<buffer  *load*-866782> nil "/Users/lakshmansankar/.emacs.d/elpa/elpy-20160131.118/elpy.el" nil t)  ; Reading at buffer position 1541
      load-with-code-conversion("/Users/lakshmansankar/.emacs.d/elpa/elpy-20160131.118/elpy.el" "/Users/lakshmansankar/.emacs.d/elpa/elpy-20160131.118/elpy.el" nil t)
      (elpy-enable)
      eval-buffer(#<buffer  *load*> nil "/Users/lakshmansankar/.emacs.d/init.el" nil t)  ; Reading at buffer position 6634
      load-with-code-conversion("/Users/lakshmansankar/.emacs.d/init.el" "/Users/lakshmansankar/.emacs.d/init.el" t t)
      load("/Users/lakshmansankar/.emacs.d/init" t t)
      #[0 "�\205\262   \306=\203�\307�\310Q\202; \311=\204�\307�\312Q\202;\313\307\314\315#\203*\316\202;\313\307\314\317#\203:\320\nB�\321\202;\316\322�\323�\322\211#\210�\322=\203a\324\325\326\307�\327Q!\"\323�\322\211#\210�\322=\203`��\210�\203\243\330�!\331\232\203\243\332�!\211\333P\334�!\203}\211\202\210\334�!\203\207�\202\210\314\262��\203\241\335��\"\203\237\336\337��#\210\340\341!\210��\266�\f?\205\260\314�\323\342\322\211#)\262�\207" [init-file-user system-type delayed-warnings-list user-init-file inhibit-default-init inhibit-startup-screen ms-dos "~" "/_emacs" windows-nt "/.emacs" directory-files nil "^\\.emacs\\(\\.elc?\\)?$" "~/.emacs" "^_emacs\\(\\.elc?\\)?$" (initialization "`_emacs' init file is deprecated, please use `.emacs'") "~/_emacs" t load expand-file-name "init" file-name-as-directory "/.emacs.d" file-name-extension "elc" file-name-sans-extension ".el" file-exists-p file-newer-than-file-p message "Warning: %s is newer than %s" sit-for 1 "default"] 7 "\n\n(fn)"]()
      command-line()
      normal-top-level()
    

    After removing python.el, things seem to work.