Hi everyone, I have been using elpy 1.16.1 in my laptop and it works fine, but recently i move my emacs configuration to another computer and install elpy 1.18 but when i open my emacs editor the next error appear
Debugger entered--Lisp error: (void-variable xref-location-marker)
byte-code("\306\307!\203\201\310\311\312\313#\210\314\315\316\317#\210\314\320\321\322#\210\323\324\325\"\210\314\315\326\317#\210\314\320\327\322#\210\323\330\331\"\210\314\315\332\317#\210\314\320\333\322#\210\323\334\335\"\210\323\336\337\"\210\314\315\340\317#\210\314\320\341\322#\210\323\342\343\"\210\314\315\344\317#\210\314\320\345\322#\210\323\346\347\"\210\350C\310\311\351\352#\210\310\311\353\354#\210\310\311\355\356#\210\310\311\357\360#\210\310\346\361\360#\210\310\342\361\360#\210\310\336\361\360#\210\310\334\361\362#\210\310\330\361\360#\210\310\324\361\360#\210\323\346\363\"\210\364 \365 r\366\n\367H>\204\276
Hi,
Could you enable debug on error (toggle-debug-on-error) and post the complete backtrace ?
From what I see, this is apparently due to xref not been loaded properly...
What happen if you add (require 'xref) before load elpy in your init.el ?
Thanks for the answer, this is what i get
Debugger entered--Lisp error: (void-variable xref-location-marker)
byte-
autoload-do-load((autoload "elpy" "Enable Elpy in all future Python buffers.\n\n(fn &optional IGNORED)" t nil) elpy-enable)
command-execute(elpy-enable record)
execute-extended-command(nil "elpy-enable" "elpy-enable")
funcall-interactively(execute-extended-command nil "elpy-enable" "elpy-enable")
call-interactively(execute-extended-command nil nil)
command-execute(execute-extended-command)
and this when i try to enable
elpy-mode: Elpy only works with ‘python-mode’
elpy-mode: Symbol’s function definition is void: elpy-modules-buffer-init
elpy-enable: Symbol’s function definition is void: elpy-modules-global-init
I assume you install elpy from melpa ?
elpy-mode: Elpy only works with ‘python-mode’
This is what you are supposed to get when trying to activate elpy in a buffer that is a non-python buffer. Is this the case here ?
Adding (require 'xref) did not change anything ?
This is what you are supposed to get when trying to activate elpy in a buffer that is a non-python buffer. Is this the case here ?
Yes that is the case
Adding (require 'xref) did not change anything ?
Nothing change
Ok, maybe xref is implemented slightly differently than we expected in the version of Emacs you are using.
Is this 24.5 (25.5 is not out yet) ?
25.3*
This is the version I am currently using as well.
This is quite strange.
Is xref-location-marker defined after doing (require 'xref)
This is the version I am currently using as well.
This is quite strange.
Is xref-location-marker defined after doing (require 'xref)
Is defined but, return that is void
This looks like old byte-compiled files after an Emacs upgrade (or downgrade). Could you uninstall Elpy and install it again?
Thanks that worked, i don't know why now works if i already tried that
FWIW, I had the same problem (migrated to new version of Emacs with old init.el file) and was able to solve it by simply deleting the *.elc files in the .emacs.d directory. No need to re-install anything.
Most helpful comment
FWIW, I had the same problem (migrated to new version of Emacs with old init.el file) and was able to solve it by simply deleting the *.elc files in the .emacs.d directory. No need to re-install anything.