python-el-get已安装emacs-jedi的程序包加载问题
作者:互联网
我已经关注了these instructions with el-get
to try to install emacs-jedi(以及其他需要的软件包),但是没有运气.
在我的.emacs文件中,添加了以下几行:
;; .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 ...
最初,我看到的问题是“无法打开加载文件jedi / jedi”.当我在加载路径中添加“〜/ .emacs.d / el-get /”时,这似乎消失了(el-get似乎仅将“〜/ .emacs.d / el-get / el-get”放在安装时的加载路径).
但是在此之后,打开Python文件并尝试使用M-x python-mode会产生错误:
Symbol's function definition is void: jedi:setup
我很乐意做更多的调试工作,或者提供更多的消息或输出-但是在谷歌搜索这些错误消息很长时间之后,我一直没找到任何尝试可以看起来很有用.
解决方法:
您缺少https://github.com/dimitri/el-get#basic-setup中提到的(el-get’sync)
另外,您不需要(package-initialize)等用于package.el的设置.一切都由el-get处理.最好不要混用两个程序包管理器.
这是通过el-get使用Jedi的最小Emacs设置:
(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.
更新:
我在手册中添加了
> http://tkf.github.io/emacs-jedi/latest/#install
> http://tkf.github.io/emacs-jedi/latest/#quick-try
标签:emacs,elisp,python,el-get,emacs-jedi 来源: https://codeday.me/bug/20191122/2055979.html