I'm having an issue where when I try to use elpy-company-backend. This doesn't work for me, however if I do company-jedi it works perfectly.
Have I configured something wrong or is this an error?
;; PYTHON CONFIGURATION
;; --------------------------------------
(use-package flycheck
:ensure t
:init
(global-flycheck-mode t))
;; Load up elpy
(elpy-enable)
(setq elpy-rpc-python-command "python3")
(setq python-shell-interpreter "ipython3"
python-shell-interpreter-args "-i --simple-prompt")
(add-hook 'python-mode-hook 'jedi:setup)
(define-key python-mode-map (kbd "M-.") 'jedi:goto-definition)
(setq jedi:complete-on-dot t)
;; use flycheck not flymake with elpy
(when (require 'flycheck nil t)
(setq elpy-modules (delq 'elpy-module-flymake elpy-modules))
(add-hook 'elpy-mode-hook 'flycheck-mode)
(setq flycheck-python-pylint-executable "pylint3")
(setq flycheck-python-flake8-executable "flake8")
)
;; enable autopep8 formatting on save
(require 'py-autopep8)
(add-hook 'elpy-mode-hook 'py-autopep8-enable-on-save)
(elpy-config)Elpy Configuration
Virtualenv........: cv (/home/nathan/.virtualenvs/cv)
RPC Python........: 3.6.5 (/home/nathan/.virtualenvs/cv/bin/python3)
Interactive Python: ipython3 (/home/nathan/.virtualenvs/cv/bin/ipython3)
Emacs.............: 27.0.50
Elpy..............: 1.21.0
Jedi..............: 0.12.0
Rope..............: Not found (0.10.7 available)
Autopep8..........: Not found (1.3.5 available)
Yapf..............: Not found (0.22.0 available)
Black.............: Not found (18.6b2 available)
Syntax checker....: flake8 (/usr/local/bin/flake8)
Everything seems ok with your configuration, so It may be an error.
Can you use the other elpy functionalities (elpy-goto-definition and elpy-doc for example) ?
Also could you try (elpy-rpc-get-completions) with the cursor on something to complete, just to try to understand where the issue come from.
By the way, company-jedi uses jedi-core while elpy implements its own mechanism to call jedi. In consequence, elpy-module-company and company-jedi are kind of redondant and you may end up having two process searching for completion if you use both of them.
By the way,
company-jediusesjedi-corewhileelpyimplements its own mechanism to call jedi. In consequence,elpy-module-companyandcompany-jediare kind of redondant and you may end up having two process searching for completion if you use both of them.
I also prejudiced the same thing. Thanks for the input. Today I can't get completion working in PyQt5. I think it was a clash between company and auto-complete (previously I think Elpy use auto-complete). Turn out Elpy use company.
Removing company-jedi config works for me. Now I get pyqt5 completion with 'vanilla' Elpy.
I was wondering how it possible, without reading the code I get your explanation above, thank you.
@galaunay So, the 'recommended' way of using Elpy is: without any additional python related package e.g company-jedi. Because Elpy already handle it out of the box, adding them just making it clash ?
@galaunay So, the 'recommended' way of using Elpy is: without any additional python related package e.g company-jedi. Because Elpy already handle it out of the box, adding them just making it clash ?
Exactly, one of Elpy's aim is to provide a complete python IDE without the burden of installing separated packages.
Happy that it is now working for you,
please close this issue if your issue is resolved.
I am not the OP :)
oops,
let's wait for SirSharpest then.
Exactly, one of Elpy's aim is to provide a complete python IDE without the burden of installing separated packages.
Alright, this is Elpy gooal.
Thanks for the input.
Most helpful comment
Everything seems ok with your configuration, so It may be an error.
Can you use the other elpy functionalities (
elpy-goto-definitionandelpy-docfor example) ?Also could you try
(elpy-rpc-get-completions)with the cursor on something to complete, just to try to understand where the issue come from.By the way,
company-jediusesjedi-corewhileelpyimplements its own mechanism to call jedi. In consequence,elpy-module-companyandcompany-jediare kind of redondant and you may end up having two process searching for completion if you use both of them.