Elpy: Getting error when loading .py files

Created on 31 May 2016  Â·  10Comments  Â·  Source: jorgenschaefer/elpy

Getting error int the linked gist when I first open a .py file in emacs

https://gist.github.com/crappyoats/c849d83143a1ad2968fe945d1efa79bc

Question

Most helpful comment

You are using the system-wide Python interpreter. Which means you likely have a library installed system-wide that emits messages to stdout/stderr even though Elpy redirects those elsewhere. Elpy uses stdout/stderr for subprocess communication. The messages you see are Elpy telling you "hey, I got this stuff I did not expect, I have no problem with this, but maybe you want to see it". You don't. Bury the buffer, ignore it, and just keep working. Nothing is wrong, except those libraries acting badly.

If you want to get rid of this completely, I can recommend using virtualenvs and not installing these libraries in the virtualenv you work in. :-)

Does this help?

All 10 comments

Hello, and thanks for the report!

This is not so much an error, but some output from Python Elpy did not expect – it does ignore it, though, so you everything else should keep working.

Looks like you have some MPI library installed (or are using it) which writes a lot to stdout/stderr?

I'm not sure about the MPI libs (I'm pretty new to the whole emacs config thing), but I am getting a lot of the error message "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" popping up.

I'm not sure about the MPI libs (I'm pretty new to the whole emacs config thing)

This is unrelated to Emacs, it's Python.

You can try python -m elpy in a terminal. It should also emit these warnings.

Added: You'll also need export PYTHONPATH=$HOME/.emacs.d/elpa/elpy-1.12.0/

I get elpy-rpc ready (1.12.0) and then a blinking cursor.

That's the correct initial handshake. You did not do anything after opening the .py file before those warnings appear?

Also, what's the output of M-x elpy-config?

No, it pops up after loading a .py file. If I kill the buffer that its in, the message pops up again in a new buffer.

https://gist.github.com/crappyoats/52ed6651ccbdcd00bc94effa1f3e05a8

Thanks again for walking me through this. Like I said I am a super noob!

You are using the system-wide Python interpreter. Which means you likely have a library installed system-wide that emits messages to stdout/stderr even though Elpy redirects those elsewhere. Elpy uses stdout/stderr for subprocess communication. The messages you see are Elpy telling you "hey, I got this stuff I did not expect, I have no problem with this, but maybe you want to see it". You don't. Bury the buffer, ignore it, and just keep working. Nothing is wrong, except those libraries acting badly.

If you want to get rid of this completely, I can recommend using virtualenvs and not installing these libraries in the virtualenv you work in. :-)

Does this help?

I tried wiping elpy and reinstalling, then I changed elpy's python to python3 and that seemed to get rid of the issue. I also added ~/.local/bin to my PATH and I haven't had any problems since.

Thanks Jorgen!

Awesome! Glad things work now. :-)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

SergiyKolesnikov picture SergiyKolesnikov  Â·  3Comments

chechoRP picture chechoRP  Â·  5Comments

IvanMalison picture IvanMalison  Â·  6Comments

kapilsh picture kapilsh  Â·  3Comments

kirk86 picture kirk86  Â·  5Comments