ELPA/Marmalade reports “cannot open load file” for ~/.emacs.d/elpa/archives/-pkg

扶醉桌前 提交于 2019-12-04 04:40:13

Easy. For whatever reason, the package.el you're now using is the "classic" version from http://tromey.com/elpa/package.el. It's wildly incompatible with recent versions of package.el. How you managed to install Marmalade packages using that version, I don't know; 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.

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.

I've stumbled upon this question while trying to solve a similar problem. In my case, forcing package-initialize have solved the problem:

;; 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. 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.

Adding a file, not directory, using touch ~/.emacs.d/elpa/archives/-pkg solved it for me.

I think it may just go away if you manually create a directory at:

c:/Documents and Settings/Carlos/Datos de programa/.emacs.d/elpa/archives/-pkg

In my case I had to add this directive to tell emacs where it can find the files required:

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))
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!