1

I am getting following error when I do M-x elpy-goto-definition, even though I have installed jedi. I have followed following answer and this one.

Error message: This feature requires the ‘jedi‘ package to be installed.


My configuration as follows:

(use-package elpy
  :ensure t
  :init
  (elpy-enable))

(setq elpy-rpc-backend "jedi")

;;;;;;; Standard Jedi.el setting
(add-hook 'python-mode-hook 'jedi:setup)
(add-hook 'python-mode-hook 'jedi:ac-setup)
(setq jedi:setup-keys t)                      ; optional
(setq jedi:complete-on-dot t)                 ; optional
(add-hook 'elpy-mode-hook (lambda () (highlight-indentation-mode -1)))

[Q] How could I combine elpy and jedi?

alper
  • 1,238
  • 11
  • 30
  • 1
    What is the output of M-x elpy-config? That should tell you if it’s having a problem accessing any components like Jedi. – AndrewE Feb 28 '20 at 14:42
  • 2
    Don't know if that is the issue, but you try to `(elpy-enable)` before `elpy` is loaded. Change `:init` to `:config` [Read at the manual about the function of both keywords](https://jwiegley.github.io/use-package/keywords/). – jue Feb 28 '20 at 15:18
  • elpy-config => https://gist.github.com/avatar-lavventura/a1e0720a337a8ceb1ccf364edd36afdf @AndrewE – alper Feb 29 '20 at 17:10
  • I have done it but still I am getting the same error @jue – alper Feb 29 '20 at 17:24
  • You might have to tell it where your Jedi binary is if it isn’t on your PATH. Look for a variable named elpy-Jedi-executable or something similar and customize it to be the path to the Jedi executable. – AndrewE Feb 29 '20 at 23:39
  • `jediepcserver.py` exists under `~/.emacs.d/elpa/jedi-core-0.2.8` – alper Mar 01 '20 at 09:49
  • 2
    @alper what happens when you click “[install jedi]” on the elpy-config screen? – AndrewE Mar 01 '20 at 16:19
  • That comment I made about Jedi executable was wrong btw, sorry. I was thinking of flycheck I think. – AndrewE Mar 01 '20 at 16:25
  • I get following output: https://gist.github.com/avatar-lavventura/bdb9b1fc063393195d07bbc53a14c5f8 // but still I am having the same error – alper Mar 01 '20 at 21:50
  • Can you restart emacs and run elpy config again to see if it is detecting the new Jedi install? – AndrewE Mar 02 '20 at 01:39
  • @alper sorry can't help, I don't use elpy nor jedi. – jue Mar 02 '20 at 13:08
  • Actually when I wait little bit it is solved. It takes around few minutes to `jedi server` to be detected by `emacs`, is it normal? – alper Mar 02 '20 at 19:12
  • I have changed `:init` to `:config` should I make any additional change as well? Eventually `jedi` loads but it takes some time@jue – alper Aug 18 '20 at 07:32

0 Answers0