3

I'm using elpy with emacs and python3. Here's the relevant part of my .emacs:

;; PYTHON
(elpy-enable)
(setq elpy-rpc-python-command "python3")
(elpy-use-ipython "ipython3")
(autoload 'jedi:setup "jedi" nil t)
(add-hook 'python-mode-hook 'jedi:setup)
(add-hook 'pyvenv-mode-hook 'jedi:setup)
(setq jedi:setup-keys t)
(setq jedi:complete-on-dot t)

Now, if I create a class in a python file, auto completion works perfectly. Then I try C-c C-c, and the class is loaded up in my ipython buffer, and I can play around with it. So far so good.

Unfortunatly, this is where I really want auto-complete, but my autocomplete experience here is a little unsatisfactory. Out of the box I can use tab to get completions in another window, but I'd like the "on dot popup" I get in python mode. Executuing jedi:setup gives me popups, but it's just builtins, and not my class methods.

How can I get the same auto complete behavior in my ipython rpc buffer as I get in my python editing buffer?

1 Answer 1

3

Elpy doesn't require emacs jedi package. Also they won't work well when both are configured. I guess there is some conflict between them.

Use only elpy and you should be able to get completion in rpc buffer.

I created an empty file with

class Foo:
    this = 2

After sending this to python buffer with C-C C-c, if i switch to python buffer and type Foo. it gives completions.

enter image description here

6
  • The claim that they won't work well together seems to contradict what elpy's own FAQ has to say on the matter!
    – jacg
    Commented Oct 12, 2017 at 9:34
  • 1
    FAQ is talking about Python Jedi. Here we are discussing emacs jedi? Commented Oct 12, 2017 at 11:13
  • Ah, now I see what you mean. Sorry about the noise.
    – jacg
    Commented Oct 12, 2017 at 11:27
  • What is your configuration for this to work? I'm in the same situation as the OP, it is not really working for me by default.
    – Daniel
    Commented Feb 10, 2019 at 20:33
  • @Daniel My elpy config github.com/ChillarAnand/eddie/blob/master/ubuntu/config/emacs/… Commented Feb 11, 2019 at 6:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.