jorgenschaefer/elpy

elpy-format-code errors out and unacceptable latency during text editing

Opened this issue · 3 comments

Summary

elpy-format-code errors out and text editing has unusably slow latency.

I'm guessing the issue is between the chair and the keyboard, but I can't figure out what might be wrong.

Steps to reproduce

M-x elpy-format-code
; error in process sentinel: peculiar error: "exited abnormally with error code 1"
; Timeout during RPC call fix_code_with_black from backend

Any time I enter a character, there is 1s+ latency before I can enter another character (error in process sentinel: peculiar error: "exited abnormally with error code 1")

My configuration

OS

Ubuntu 20.04

Result of (elpy-config)

Emacs.............: 26.3
Elpy..............: 1.35.0
Virtualenv........: venv (/home/fp/projects/discord_date/venv)
Interactive Python: python3 3.8.10 (/home/fp/projects/discord_date/venv/bin/python3)
RPC virtualenv....: venv (/home/fp/projects/discord_date/venv)
 Python...........: python3 3.8.10 (/home/fp/projects/discord_date/venv/bin/python3)
 Jedi.............: Not found (0.18.1 available)
 Autopep8.........: Not found (1.6.0 available)
 Yapf.............: Not found (0.32.0 available)
 Black............: 22.3.0
Syntax checker....: flake8 (/home/fp/.local/bin/flake8)Emacs.............: 26.3

Elpy configuration in my init.el

(ensure-package-installed 'elpy)  ; installs elpy from melpa/elpa if it isn't already
(require 'elpy)
(elpy-enable)
(setq elpy-rpc-virtualenv-path 'current)
(add-hook 'elpy-mode-hook
	  (lambda ()
	    (add-hook 'before-save-hook
		      'elpy-format-code nil t)))

I believe it happens because jedi is not installed. I have the same issue and would like to do not install jedi and other packages, because it slwos down work with Tramp on ssh file. Did you find a solution on how to suppress this error?

error in process sentinel: peculiar error: "exited abnormally with error code 1"

Something similar happened to me after I installed a new python version (I upgraded an Ubuntu system).

Reinstalling the RPC venv (M-x elpy-rpc-reinstall-virtualenv) fixed this error for me.

j3pic commented

On my system this was caused by installing both the Debian version of Elpy and the GitHub version. Emacs ended up loading parts of Elpy from the Debian package.