3

I've followed these instructions with el-get to try to install emacs-jedi (and the other needed packages), but no luck.

In my .emacs file, I've added the following lines:

;; .emacs

;; Load package repositories
(require 'package)
(add-to-list 'package-archives
             '("marmalade" . "http://marmalade-repo.org/package/") t)

(add-to-list 'package-archives
             '("melpa" . "http://melpa.milkbox.net/packages/") t)

;; Install / load / require el-get and
;; packages managed by it.
(add-to-list 'load-path "~/.emacs.d/el-get/")
(add-to-list 'load-path "~/.emacs.d/el-get/el-get")

(unless (require 'el-get nil t)
  (url-retrieve
   "https://raw.github.com/dimitri/el-get/master/el-get-install.el"
   (lambda (s)
     (end-of-buffer)
     (eval-print-last-sexp))))

;; Initialize any loaded packages 
(package-initialize)

;; stuff to set font, theme, etc.
;; ...

;; Include jedi for Python mode.
(add-hook 'python-mode-hook 'jedi:setup)
(setq jedi:complete-on-dot t)

;; rest of file ...

At first, I was seeing the issue "cannot open load file jedi/jedi." This seemed to go away when I added "~/.emacs.d/el-get/" to the load path (el-get seems to only place "~/.emacs.d/el-get/el-get" on the load path when installing).

But after this, opening a Python file and trying M-x python-mode yields an error:

Symbol's function definition is void: jedi:setup

I'm happy to do any more debugging or to provide more messages or output -- but after Googling for these error messages for a long time, I have been unable to find anything to try that seemed productive.

ely
  • 74,674
  • 34
  • 147
  • 228
  • 1
    I see that you're already using MELPA. You can just get `jedi` from there. And don't forget to `sudo pip install jedi epc`. – abo-abo Mar 17 '14 at 18:38
  • `MELPA` worked almost instantly once I purged out all of the `el-get` stuff. – ely Mar 17 '14 at 20:22
  • @abo-abo "pip install jedi epc" is not recommended. Use jedi:install-server. http://tkf.github.io/emacs-jedi/latest/#jedi:install-server – tkf Mar 17 '14 at 20:34

1 Answers1

3

You are missing (el-get 'sync) which is mentioned in https://github.com/dimitri/el-get#basic-setup

Also, you don't need (package-initialize) etc. for package.el setup. Everything is handled by el-get. It is a good idea to not mix two package managers.

Here is a minimal Emacs setup to use Jedi via el-get:

(add-to-list 'load-path "~/.emacs.d/el-get/el-get")

;; Uncomment this, if you are in hurry
;; (setq el-get-install-skip-emacswiki-recipes nil)

(unless (require 'el-get nil 'noerror)
  (with-current-buffer
      (url-retrieve-synchronously
       "https://raw.github.com/dimitri/el-get/master/el-get-install.el")
    (goto-char (point-max))
    (eval-print-last-sexp)))

(el-get 'sync)

(add-hook 'python-mode-hook 'jedi:setup)
(setq jedi:complete-on-dot t)

;; Type:
;; - M-x el-get-install RET jedi RET
;; - M-x jedi:install-server RET
;; Then open any Python file.

Update:

I added it in the manual

  1. http://tkf.github.io/emacs-jedi/latest/#install
  2. http://tkf.github.io/emacs-jedi/latest/#quick-try
tkf
  • 2,990
  • 18
  • 32
  • When I include the line `(el-get 'sync)` and try `M-x eval-current-buffer`, it says, "Wrong type argument. stringp, nil" – ely Mar 17 '14 at 19:19
  • Backup ~/.emacs.d to another place and try from empty ~/.emacs.d. If it does not work, then that is el-get's bug. Report to el-get issue tracker. – tkf Mar 17 '14 at 19:43
  • That did not work at all. After moving .emacs.d to a backup, I got this: `el-get-convert-from-old-status-format: Opening output file: no such file or directory, /home/ely/.emacs.d/el-get/.status.el.old` – ely Mar 17 '14 at 20:16
  • I tried deleting the contents of `.emacs.d/el-get` and re-installing, but now I see the "Wrong type argument. strinp nil" constantly. It looks to be coming from this: `Wrote /home/ely/.emacs.d/el-get/.loaddefs.elc byte-code: Wrong type argument: stringp, nil el-get: updating autoloads for jedi el-get: byte-compiling autoload file byte-code: Wrong type argument: stringp, nil byte-code: End of buffer [2 times]` – ely Mar 17 '14 at 20:17
  • Also, re-installing `el-get` looks like it just hangs. It says "connecting to raw.github.com` in the message console, but doesn't appear to be doing anything. – ely Mar 17 '14 at 20:18
  • In the end I just purged it, removed the references to `el-get` and just did `M-x package-install (ret) jedi` and it worked immediately. – ely Mar 17 '14 at 20:22
  • Installing el-get for the first time takes *very* long time if you don't set `(setq el-get-install-skip-emacswiki-recipes nil)` as I mentioned in the answer. – tkf Mar 17 '14 at 20:22
  • Re M-x package-install. Then you are using pacakge.el directory rather than el-get. In that case, it is safe to remove all el-get related setup. – tkf Mar 17 '14 at 20:23
  • Correct. I was not using package.el last night and earlier today when I went through all of your instructions and the instructions from the blog post that I linked. But after those did not work for me, I switched to package.el and it did work on the first try. – ely Mar 17 '14 at 20:25