3

I have installed elpy tonight, but it seems that it cannot start properly a Python virtualenv, and it's complaining as reported below.

First, I installed use-package and elpy from Melpa, and I added, per elpy's manual,

(use-package elpy
  :ensure t
  :init
  (elpy-enable))

to my init file.

Next, I opened a Python file and I got this message

error in process sentinel: elpy-promise-reject: peculiar error: "exited abnormally with code 1"
error in process sentinel: peculiar error: "exited abnormally with code 1"

At this point I turned on debug on error, and promptly I got this backtrace

Debugger entered--Lisp error: (process-sentinel "exited abnormally with code 1")
  elpy-rpc--default-error-callback((process-sentinel "exited abnormally with code 1"))
  elpy-promise-reject([*elpy-promise* #<subr F616e6f6e796d6f75732d6c616d626461_anonymous_lambda_30> elpy-rpc--default-error-callback #<buffer  *elpy-rpc [project:~/Documents/Code/ environment:/usr]*> nil] (process-sentinel "exited abnormally with code 1"))
  #f(compiled-function (call-id promise) #<bytecode 0x15ab78ddb8c11359>)(1 [*elpy-promise* #<subr F616e6f6e796d6f75732d6c616d626461_anonymous_lambda_30> elpy-rpc--default-error-callback #<buffer  *elpy-rpc [project:~/Documents/Code/ environment:/usr]*> nil])
  elpy-rpc--sentinel(#<process  *elpy-rpc [project:~/Documents/Code/ environment:/usr]*> "exited abnormally with code 1\n")

How can I solve this issue?


Followup to Drew's comment (TL;DR it's not an interference from other packages).

  1. I started Emacs with emacs -Q

  2. I evaluated

     (require 'package)
     (add-to-list 'package-archives '("melpa" . "http://melpa.org/packages/") t)
     (package-initialize)
    

    ;; If there are no archived package contents, refresh them (when (not package-archive-contents) (package-refresh-contents)) (use-package elpy :ensure t :init (elpy-enable))

  3. I opened a Pyton source code file, and I've experienced the same behaviour described above.

gboffi
  • 614
  • 4
  • 20
  • Find out what program elpy was running (probably elpy-rpc-python-command), and find out what it means when it exits with error code 1. Then you’ll know what the problem is and how to fix it. – db48x Nov 12 '22 at 19:52
  • Do you see the problem if you start Emacs with emacs -Q? If so, bisect your init file to find the culprit. If not, report a bug to the Elpy maintainer. – Drew Nov 12 '22 at 21:41
  • @Drew TY for the suggestion, I did what you've asked (details in the edited answer) but the problem remains. – gboffi Nov 12 '22 at 22:37
  • 1
    Unless you get a helpful answer here (or at [email protected]), I'd suggest contacting the Elpy maintainer. – Drew Nov 13 '22 at 02:31

0 Answers0