elpy icon indicating copy to clipboard operation
elpy copied to clipboard

error on `elpy-goto-definition`: `elpy-rpc-warn-if-jedi-not-available`, even though `jedi` is available

Open alienbogart opened this issue 2 years ago • 3 comments

Steps to reproduce

  1. Open Python file
  2. M-x elpy-goto-definition

It should go to the definition at point. Instead, I get the message: elpy-rpc-warn-if-jedi-not-available: This feature requires the ‘jedi‘ package to be installed. I have jedi installed on my system via PIP. I also installed it via package manager after the error (sudo pacman -S jedi-language-server python-jedi), but there was no change. elpy-config correctly finds Jedi 0.18.1. I also installed the package jedi on Emacs, but this had no effect.

Sometimes I get the message void-variable find-tag-marker-ring instead. Here's the backtrace:

Debugger entered--Lisp error: (void-variable find-tag-marker-ring)
  elpy-goto-location("/home/dave/Dropbox/doc/study/python_study/scratch...." 2429)
  elpy-goto-definition()
  #<subr funcall-interactively>(elpy-goto-definition)
  apply(#<subr funcall-interactively> elpy-goto-definition)
  funcall-interactively(elpy-goto-definition)
  #<subr call-interactively>(elpy-goto-definition nil nil)
  apply(#<subr call-interactively> (elpy-goto-definition nil nil))
  explain-pause--wrap-call-interactively(#<subr call-interactively> elpy-goto-definition nil nil)
  apply(explain-pause--wrap-call-interactively #<subr call-interactively> (elpy-goto-definition nil nil))
  call-interactively(elpy-goto-definition nil nil)
  command-execute(elpy-goto-definition)

My configuration

OS

Manjaro, current.

Result of (elpy-config)

Elpy Configuration

Emacs.............: 27.2
Elpy..............: 1.35.0
Virtualenv........: None
Interactive Python: python 3.10.2 (/usr/bin/python)
RPC virtualenv....: rpc-venv (/home/$USER/.emacs.d/.local/etc/elpy/rpc-venv)
 Python...........: python 3.10.2 (/home/$USER/.emacs.d/.local/etc/elpy/rpc-venv/bin/python)
 Jedi.............: 0.18.1
 Autopep8.........: 1.6.0
 Yapf.............: 0.32.0
 Black............: 22.1.0
Syntax checker....: flake8 (/home/$USER/.local/bin/flake8)

Warnings

You have not activated a virtual env. It is not mandatory but often a good idea
to work inside a virtual env. You can use `M-x pyvenv-activate` or `M-x
pyvenv-workon` to activate one.

Options

Square brackets indicate buttons; type RET or click mouse-1 on a button to
invoke its action. Invoke [+] to expand a group, and [-] to collapse an expanded
group. Invoke the [Group], [Face], and [Option] buttons below to edit that item
in another window.

[+]-- [Group] Elpy
[+]-- [Group] Python
[+]-- [Group] Virtual Environments (Pyvenv)
[+]-- [Group] Completion (Company)
[+]-- [Group] Call Signatures (ElDoc)
[+]-- [Group] Inline Errors (Flymake)
[+]-- [Group] Code folding (hideshow)
[+]-- [Group] Snippets (YASnippet)
[+]-- [Group] Directory Grep (rgrep)
[+]-- [Group] Search as You Type (ido)
[+]-- [Group] Django extension
[+]-- [Group] Autodoc extension

Elpy configuration in my init.el

(use-package! elpy
  :after python
  :init
  (advice-add 'python-mode :before 'elpy-enable))```

alienbogart avatar Feb 11 '22 08:02 alienbogart

For me it works only with jedi-0.17.2.

conda install jedi==0.17.2 jedi-language-server black autopep8 yapf

max0x7ba avatar Jun 22 '22 22:06 max0x7ba

The (void-variable find-tag-marker-ring) error should be fixed in https://github.com/jorgenschaefer/elpy/pull/1988

yatsky avatar Jun 24 '22 03:06 yatsky

I downgraded to jedi==0.17.2 in my rpc-venv to fix this error, even though I seem to have latest elpy

plpxsk avatar Jul 10 '23 21:07 plpxsk