[英]ELPA/Marmalade reports “cannot open load file” for ~/.emacs.d/elpa/archives/-pkg
I have installed Marmalade and downloaded some interesting packages. 我已经安装了Marmalade并下载了一些有趣的软件包。 But now, when I start Emacs I get this error: 但现在,当我启动Emacs时,我收到此错误:
Cannot open load file: c:/Documents and Settings/Carlos/Datos de programa/.emacs.d/elpa/archives/-pkg
If I use --debug-init
, I get: 如果我使用--debug-init
,我得到:
Debugger entered--Lisp error: (file-error "Cannot open load file" "c:/Documents and Settings/Carlos/Datos de programa/.emacs.d/elpa/archives/-pkg")
load("c:/Documents and Settings/Carlos/Datos de programa/.emacs.d/elpa/archives/-pkg" nil t)
(if (file-directory-p pkg-dir) (load (concat pkg-dir ... "-pkg") nil t))
(let ((pkg-dir ...)) (if (file-directory-p pkg-dir) (load ... nil t)))
package-load-descriptor("c:/Documents and Settings/Carlos/Datos de programa/.emacs.d/elpa/" "archives")
(lambda (name) (package-load-descriptor dir name))("archives")
mapc((lambda (name) (package-load-descriptor dir name)) ("anything-1.287" "anything- complete-1.86" "anything-config-0.4.1" "archive-contents" "archive-contents~" "archives" "auto-indent-mode-0.35" "builtin-packages" "builtin-packages~" "clojure-mode-1.7.1" "clojurescript-mode-0.5" "coffee-mode-0.3.0" "color-file-completion-1.0.1" "color-theme-6.6.1" "color-theme-eclipse-0.0.2" "color-theme-github-0.0.3" "color-theme-railscasts-0.0.2" "color-theme-twilight-0.1" "css-mode-1.0" "drag-stuff-0.0.3" "evernote-mode-0.41" "find-file-in-project-2.0" "flymake-coffee-0.4" "flymake-haml-0.5" "flymake-ruby-0.4" "flymake-shell-0.5" "haml-mode-3.0.14" "highlight-parentheses-1.0.1" "html-script-src-0.0.2" "inf-ruby-2.1" "js-comint-0.0.1" "js2-mode-20090814" "lua-mode-20100617" "package.el" "package.el~" "project-local-variables-0.2" "ruby-compilation-0.7" "ruby-electric-1.1" "ruby-mode-1.1" "slime-20100404" "tabbar-2.0.1" "tabbar-ruler-0.2" "yasnippet-0.6.1" "yasnippet-bundle-0.6.1" "zenburn-1.8"))
(if (file-directory-p dir) (mapc (lambda ... ...) (directory-files dir nil "^[^.]")))
(lambda (dir) (if (file-directory-p dir) (mapc ... ...)))("c:/Documents and Settings/Carlos/Datos de programa/.emacs.d/elpa/")
mapc((lambda (dir) (if (file-directory-p dir) (mapc ... ...))) ("c:/Documents and Settings/Carlos/Datos de programa/.emacs.d/elpa/" "/usr/share/emacs/site-lisp/elpa/"))
package-load-all-descriptors()
package-initialize()
(progn (package-initialize))
(if (load (expand-file-name "~/.emacs.d/elpa/package.el")) (progn (package-initialize)))
(when (load (expand-file-name "~/.emacs.d/elpa/package.el")) (package-initialize))
eval-buffer(#<buffer *load*> nil "c:/Documents and Settings/Carlos/Datos de programa/.emacs" nil t) ; Reading at buffer position 9019
load-with-code-conversion("c:/Documents and Settings/Carlos/Datos de programa/.emacs" "c:/Documents and Settings/Carlos/Datos de programa/.emacs" t t)
load("~/.emacs" t t)
#[nil "\205\264
This file doesn't exist. 该文件不存在。 I've tried searching for this problem with Google but I didn't find anything. 我试过用谷歌搜索这个问题,但我没找到任何东西。
Easy. 简单。 For whatever reason, the package.el
you're now using is the "classic" version from http://tromey.com/elpa/package.el
. 无论出于何种原因,您现在使用的package.el
是来自http://tromey.com/elpa/package.el
的“经典”版本。 It's wildly incompatible with recent versions of package.el
. 它与最新版本的package.el
完全不兼容。 How you managed to install Marmalade packages using that version, I don't know; 我不知道你是如何设法使用该版本安装Marmalade软件包的; you must have had a different version of package.el
when you installed those packages, perhaps because you were using a newer Emacs at the time. 安装这些软件包时,你必须拥有不同版本的package.el
,这可能是因为你当时正在使用更新的Emacs。
The fix is to use the version bundled with your Emacs (if it's new enough to have one), or to replace your ~/.emacs.d/elpa/package.el
with this version instead, as described in the Marmalade instructions . 修复方法是使用与Emacs捆绑在一起的版本(如果它足够新的话),或者用这个版本替换你的~/.emacs.d/elpa/package.el
,如Marmalade说明中所述 。
I've stumbled upon this question while trying to solve a similar problem. 我试图解决类似的问题时偶然发现了这个问题。 In my case, forcing package-initialize
have solved the problem: 在我的情况下,强制package-initialize
解决了这个问题:
;; init.el
(require 'package)
(package-initialize)
Even though I did not read the source code for package.el
, I believe some kind of laziness in package.el is cousing the problem. 虽然我没有阅读package.el
的源代码,但我相信package.el
某种懒惰会引发问题。 Athough this is and old question, I wanted to answer, in case someone else need some help. 虽然这是一个古老的问题,我想回答,以防其他人需要一些帮助。
For more information on Emacs start-up, see http://www.gnu.org/software/emacs/manual/html_node/elisp/Startup-Summary.html . 有关Emacs启动的更多信息,请参阅http://www.gnu.org/software/emacs/manual/html_node/elisp/Startup-Summary.html 。
添加文件,而不是目录,使用touch ~/.emacs.d/elpa/archives/-pkg
为我解决了这个问题。
In my case I had to add this directive to tell emacs where it can find the files required: 在我的情况下,我不得不添加此指令来告诉emacs它可以找到所需的文件:
First this line 首先这一行
(add-to-list 'load-path "~/.emacs.d/")
And the required package ... 和所需的包......
(require 'package)
(add-to-list 'package-archives
'("marmalade" . "http://marmalade-repo.org/packages/") t)
(package-initialize)
(when (not package-archive-contents)
(package-refresh-contents))
我想如果您在以下位置手动创建目录,它可能会消失:
c:/Documents and Settings/Carlos/Datos de programa/.emacs.d/elpa/archives/-pkg
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.