How to configure Jedi with elpy in emacs?

I use emacs with elpy as a mode for working with python code. I also installed Jedi for basically two things: go to the definition function that it provides, and autocomplete.

However, in this setup, I ran into the following problems:

  • Jedi completion does not start with key commands. It appears automatically, but sometimes too late for my tastes, and I would prefer to try and call it earlier. However, even though there is a Jedi: key key on the setup pages, it does not seem to have any effect. On the other hand, the elpy corporate identity label does it on C-M-i.
  • When the Jedi and corporate mode work, sometimes two completion lists appear (with the same contents, I also have a jedi backend installed), but only one of them allows you to change the selection (completion list from Jedi), but the choice from the company is used for Enter. This is not applicable.

Is there a way to set things up so that I have autocomplete from the same source with the Jedi backend and Jedi to get to the definition?

This is how I install jedi in mine init.el:

(add-hook 'python-mode-hook 'jedi:setup)
(setq jedi:complete-on-dot t)
+4
source share
1 answer

According to the elpy doc, you just need to install the elpy package. Then use the configuration below

(elpy-enable)  
(setq elpy-rpc-backend "jedi")  
     

.    https://github.com/jorgenschaefer/elpy .

+6

All Articles