-
Notifications
You must be signed in to change notification settings - Fork 261
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
elpy-goto-definition
is broken, asks for jedi
. elpy-config
shows that jedi
is recognized
#1795
Comments
It somehow picks the wrong python binaries ( Could you check the results of the following snippet: (with-elpy-rpc-virtualenv-activated
(message "RPC binaries: '%s'" (executable-find elpy-rpc-python-command)))
(message "User binaries: '%s'" (executable-find elpy-rpc-python-command)) |
The problem was solved by itself, and I'm not sure how. |
The issue came back. It's exactly the same problem. So I ran: (with-elpy-rpc-virtualenv-activated
(message "RPC binaries: '%s'" (executable-find elpy-rpc-python-command)))
(message "User binaries: '%s'" (executable-find elpy-rpc-python-command)) And the result was Here's my Elpy Config:
|
I guess you are starting Emacs from an environment where pyenv is activated (as opposed to using Elpy is failing to import the Jedi package for some reasons... (defun elpy-tmp()
(message "Outside RPC:")
(message " Python RPC: %s" (executable-find elpy-rpc-python-command))
(message " Python shell: %s" (executable-find python-shell-interpreter))
(message " Library-root: %s" (elpy-library-root))
(message " Env: %s" (car (elpy-rpc--environment)))
(with-elpy-rpc-virtualenv-activated
(message "Inside RPC:")
(message " Current env deactivated ?: %s"
current-environment-is-deactivated)
(message " Python RPC: %s" (executable-find elpy-rpc-python-command))
(message " Python shell: %s" (executable-find python-shell-interpreter))
(message " Library-root: %s" (elpy-library-root))
(message " Env: %s" (car (elpy-rpc--environment))))) Is is just printing some important variables that deals with the RPC. |
I have the same issue now. Below is elpy-tmp() output
And output of elpy-config
|
There was also a issue with jedi 0.18.0 on anaconda-mode. However they could solve it. Maybe its related. See their issue. |
Having the same issue, providing some more context here. My configuration Elpy Configuration Emacs.............: 28.0.50 Elpy configuration in init.el (this is all that is in init.el) ;; Add repos. Also, I installed jedi manually from elpa and, once jedi server is up and running, it navigates through the simple python files as expected, BUT elpy still says that jedi is not installed. |
I had the same issue on a slightly older emacs. For me, (re-)running My entire environment is a little bit of a message undergoing python2 -> python3 upgrades, but it was working well for me earlier, and then I started seeing this issue. Version:
After this, I ran
|
Start facing this issue after upgrading elpy to 1.35 (I think). I am not sure if this happens only when trying to work with python2 projects or general (I can report later after checking with python3 codebase) Output from the
I am curious about this Output of elpy-config after disabling the virtualenv from the project
|
It may be a change in jedi 0.18 we are not supporting. |
I haved tried 0.17 & 0.16, both has the same problem |
I'm using straight.el so that it's easy to checkout previous versions. What I'm confused about is I still can't find definitions with older versions. For example, say I roll back to v1.34.0 (980705c), the last release. I rebuild elpy with
I still can't find definitions. Let me try rolling back further to elpy v1.33.0 (b69ae76). Do
I still can't find definitions. Now, I know that between Mar 23, 2020 and about a month or two ago, say Feb 1, 2021, I was able to find definitions. I'm not sure what prevents these rollbacks from working. Is it Python 3.8.8? Python 3.8 was released Oct. 14, 2019, so unless there's a bug within an older version, that ought not be the problem. Unfortunately, I'm bound to Python 3.8 by job requirements. I've been using Conda environments this whole time, again a work requirement. The packages are being seen, as reported by I do see that Does anyone have a working configuration for Python 3.8? Can you please share your For anyone needing a workaround, I am using ripgrep with rg.el to just search the project directory for the module I want. |
Here's a work around using dumb-jump. Apparently, because I'm evil, I've been using However, simply adding another lookup function, like ;; won't work immediately; read on...
(add-hook 'xref-backend-functions #'dumb-jump-xref-activate) It doesn't work because elpy adds a local hook when ;; in define-miner-mode elpy-mode
(when (boundp 'xref-backend-functions)
(add-hook 'xref-backend-functions #'elpy--xref-backend nil t)) It's not clear to me how
Since the hook is applied locally, it's not as simple to remove, afaict, as ;; add this and the dumb-jump hook will work
(advice-add 'elpy--xref-backend :override #'dumb-jump-xref-activate) I've opted to take the advice route. Now |
to workaround xref-find-definitions/elpy-goto-definition issue jorgenschaefer/elpy#1795
to workaround xref-find-definitions/elpy-goto-definition issue jorgenschaefer/elpy#1795
I'm having the same issue. tried @excalamus approach by using dumb-jump but M-. just hang. managed to get M-. working by running lsp and lsp-jedi on top of elpy... |
This method works quite well for me, thanks. |
Summary
I'm getting this message when trying to run
elpy-goto-definition
:elpy-rpc-warn-if-jedi-not-available: This feature requires the ‘jedi‘ package to be installed. Please check ‘elpy-config‘ for more information.
, even thoughelpy-config
correctly identifiesjedi
doesn't show any error.Steps to reproduce
Run
elpy-goto-definition
on any object.My configuration
OS
macOS Mojave 10.14.6
Result of
(elpy-config)
Elpy configuration in my init.el
My Settings
The text was updated successfully, but these errors were encountered: