ELPA/Marmalade reports "cannot open load file" for ~/.emacs.d/elpa/archives/-pkg
Asked Answered
A

5

7

I have installed Marmalade and downloaded some interesting packages. But now, when I start Emacs I get this error:

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

If I use --debug-init, I get:

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.

Abysmal answered 17/11, 2011 at 3:0 Comment(0)
G
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.

Goles answered 17/11, 2011 at 13:0 Comment(3)
i'm running into the same problems and this solution isn't working for me. when i add the package.el file to ~/.emacs.d/elpa/package.el and eval the .emacs buffer i get (file-error "Cannot open load file" "package")Cairo
There are 2 possible places for your emacs init file. One is ~/.emacs, and the other is ~/.emacs.d/init.el. Since you're using the former, I believe that the ~/.emacs.d isn't put on your load-path. Try using the latter layout instead. Ultimately, the best solution is to use a recent Emacs version so that package.el is bundled. There have been several suitable stable releases.Goles
I think you meant "I deleted my emacs, things work a lot better now" :DJustice
D
4

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.

Demers answered 19/3, 2013 at 10:51 Comment(3)
I recently ran into exactly this problem with org-mode export, after I had to do a clean install of Ubuntu 12.10 over a corrupted+botched upgrade. This has solved the problem for now with minimal fussManheim
Also read C-h i g (emacs) Package Installation RET beginning from "The reason automatic package loading occurs after loading the init file is that user options only receive their customized values after loading the init file, including user options which affect the packaging system."Dekeles
You can use after-init-hook in order to evaluate custom code after the normal package initialization has completed. e.g.: (add-hook 'after-init-hook 'my-after-init-hook) (defun my-after-init-hook () ...)Dekeles
C
1

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

Casebook answered 8/3, 2013 at 22:42 Comment(0)
E
0

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
Emilioemily answered 17/11, 2011 at 7:49 Comment(0)
M
0

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))
Merc answered 18/9, 2013 at 10:43 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.