jorgenschaefer/elpy

elpy-shell-send-statement does not work but elpy-shell-send-region-or-buffer does, sort of

Closed this issue · 2 comments

Summary

using elpy-shell-send-statement , elpy-shell-send-statement-and-step, or elpy-shell-send-group-and-step

gives:

elpy-shell--current-line-code-line-p: Symbol’s function definition is void: python-info-current-line-comment-p

but

elpy-shell-send-region-or-buffer

sends the command. The python 3 shell first complains about an emacs module. I manually install it and loaded it then it works.

>>> Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name 'emacs' is not define

shouldn't it automatically load the emacs module if it is needed?

My configuration

OS

mac os Monterey 12.2.1

Result of (elpy-config)

Elpy Configuration

Emacs.............: 28.1
Elpy..............: 1.35.0
Virtualenv........: torch (/Users/fred/envs/torch/)
Interactive Python: python ... (/Users/fred/envs/torch/bin/python)
RPC virtualenv....: rpc-venv (/Users/fred/.emacs.d/elpy/rpc-venv)
 Python...........: python 3.9.12 (/Users/fred/.emacs.d/elpy/rpc-venv/bin/python)
 Jedi.............: 0.18.1
 Autopep8.........: 1.6.0
 Yapf.............: 0.32.0
 Black............: 22.3.0
Syntax checker....: flake8 (/Users/fred/envs/torch/bin/flake8)

I cleaned up the .emacs and now everything seems to be working. Not sure what is was.

just to add more clarification, the issue came from an old python.el file that was being loaded with load-path. Once I removed it is starting using the correct version of python.el.