Closed Krisselack closed 3 years ago
The issue disappeared after setting: (set-language-environment "UTF-8") in my init. Windows uses a different encoding. Maybe this can be included?
There is some issues in windows I am trying to fix. Thanks for the report and the info about encoding, very helpful.
I will fix this (if possible) or add a note in the documentation for windows users.
I managed to solve it with adding the following to my .emacs:
(setenv "PYTHONIOENCODING" "utf-8") (add-to-list 'process-coding-system-alist '("elpy" . (utf-8 . utf-8))) (add-to-list 'process-coding-system-alist '("python" . (utf-8 . utf-8))) (add-to-list 'process-coding-system-alist '("flake8" . (utf-8 . utf-8)))
Alternatively,
(set-language-environment "UTF-8")
this worked, but screwed up my R-setup.
I'm suddenly getting this same error continuously from Ubuntu 21.04, despite using elpy successfully for years. @Krisselack's solution didn't seem to make any difference. Every time this errors, it freezes up Emacs for a second or so, so I've had to disable elpy. Here's the backtrace I'm getting (scrubbed of some file names). This error came from a remote file, but it also happens locally:
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:/ssh:*****:/*********/test/fixtures/ environment:/usr]*> nil] (process-sentinel "exited abnormally with code 1"))
#f(compiled-function (call-id promise) #<bytecode 0x112dd5626b194b59>)(1 [*elpy-promise* #<subr F616e6f6e796d6f75732d6c616d626461_anonymous_lambda_30> elpy-rpc--default-error-callback #<buffer *elpy-rpc [project:/ssh:*****:/**********/test/fixtures/ environment:/usr]*> nil])
elpy-rpc--sentinel(#<process *elpy-rpc [project:/ssh:*****:/*********/test/fixtures/ environment:/usr]*> "exited abnormally with code 1\n")
Instead, what solved it for me was completely removing elpy from Emacs (in my case, deleting it from the straight.el cache), and re-installing. Suddenly, no problems.
In the meantime I also stopped using elpy in windows. Thd problem kind of returned after updating.
Similar to @thornjad, completely uninstalling and reinstalling fixed this issue for me (which cropped up after I updated elpy). Completely uninstalling in my case also involved deleting the elpy folder in .emacs.d. After reinstalling, it will ask
Automatically install the RPC dependencies from PyPI (needed for completion, autoformatting and documentation) ? y
Elpy is installing the RPC dependencies...
Done
Seems to work fine now after this.
I was only facing this issue whenever elpy
was running outside virtual envs, and all of my virtual envs have python3
. I was able to fix the issue by updating the elpy-rpc-python-command
variable to point to python3
instead of the default python
, which in most system for backward compatibility is set to python 2.7. On the restart elpy did what @brtsay has mentioned in the output.
Thanks to your recent activity @brtsay and @t3pleni9, I gave it another go.
I also completely removed my elpy (incl. elpy-folder in .emacs.d) and reinstalled the melpa version. Looks good so far: sphinx, flymake/flake, jedi, ...
Last time I tried, emacs started to become incredibly slow and unusable... this seems to have been fixed. I will close the issue for now. Also many thanks to @jorgenschaefer
Hi all. I am using MELPA and I am encountering this issue...I can't even run M-x elpy-config, it says it can't find python excecutable, despite me adding it to PATH. Any help?
I'm having this problem. I've tried everything in this thread, and others. The two error messages are these:
error in process sentinel: elpy-rpc--default-error-callback: peculiar error: "exited abnormally with code 1"
error in process sentinel: peculiar error: "exited abnormally with code 1"
MacOS 11.5.2 Big Sur Emacs 27.2 pipenv 2021.5.29
It happens with Python 3.9.7 while inside pipenv, and also with MacOS's legacy Python 2.7.16 when outside pipenv.
EMACS INSTALLED PACKAGES:
better-defaults-20210222.1928
company-20210909.1505
elpy-20210630.2317
highlight-indentation-20210221.1418 material-theme-20210904.1226
pyvenv-20210527.829
s-20210616.619
yasnippet-20200604.246
Elpy Configuration:
Emacs.............: 27.2 Elpy..............: 1.35.0 Virtualenv........: None Interactive Python: python 3.9.7 (/Users/[]/.local/share/virtualenvs/scrap-1fa-HuZ1/bin/python) RPC virtualenv....: rpc-venv (/Users/[]/.emacs.d/elpy/rpc-venv) Python...........: python3 3.8.2 (/Users/[]/.emacs.d/elpy/rpc-venv/bin/python3) Jedi.............: Not found (0.18.0 available) Autopep8.........: Not found (1.5.7 available) Yapf.............: Not found (0.31.0 available) Black............: Not found (21.9b0 available) Syntax checker....: Not found (flake8)
Ok, I made one change, installing Jedi, and that fixed it. Seems to be working fine in both pipenv/Python3 and straight Python2.7.16.
So now:
Elpy Configuration:
Emacs.............: 27.2 Elpy..............: 1.35.0 Virtualenv........: None Interactive Python: python 3.9.7 (/Users/[]/.local/share/virtualenvs/scrap-1fa-HuZ1/bin/python) RPC virtualenv....: rpc-venv (/Users/[]/.emacs.d/elpy/rpc-venv) Python...........: python3 3.8.2 (/Users/[]/.emacs.d/elpy/rpc-venv/bin/python3) Jedi.............: 0.18.0 Autopep8.........: Not found (1.5.7 available) Yapf.............: Not found (0.31.0 available) Black............: Not found (21.9b0 available) Syntax checker....: Not found (flake8)
I am using mac Catalina 10.15.7, emacs 27.2, elpy 1.35.0, I use a virtual environment basing on python3.7.
Then encountered "exit abnormally with code 1" and freezed for about 1s every time. In my previous config, jedi, autopep8, yapf and black are not find.
Then I figure it might be because that the rpc cannot be properly initialized. After running M-x elpy-rpc-reinstall-virtualenv
it fixed the issue also set up the jedi and other packages for me. Hope this helps.
Summary
I keep getting this error continuously: error in process sentinel: elpy-rpc--default-error-callback: peculiar error: "exited abnormally with code 1" error in process sentinel: peculiar error: "exited abnormally with code 1"
Then the panel freezes for 1 sec or so, making elpy quite unusable on a win10 machine.
Steps to reproduce
open a .py file
My configuration
OS
Win10
Result of
(elpy-config)
Elpy configuration in my init.el
output: (elpy-rpc-init (elpy-library-root))