el-get icon indicating copy to clipboard operation
el-get copied to clipboard

The package ‘dash’ has already been loaded by package.el, attempting to load el-get version instead

Open Xparx opened this issue 4 years ago • 3 comments

Hello, I get the following warning when trying to install a few packages (same/similar to the issue here: https://github.com/dimitri/el-get/issues/2335).

Warning (el-get): The package ‘dash’ has already been loaded by
package.el, attempting to load el-get version instead. To avoid
this warning either uninstall one of the el-get or package.el
version of dash, or call ‘el-get’ before ‘package-initialize’ to
prevent package.el from loading it.

The suggested solution in that thread escapes me. I try to put (el-get) at the top of my init.el file but it does nothing. How should I "call 'el-get' before package-initialize" and how should I handle the install of el-get in this case?

Xparx avatar Jun 28 '20 19:06 Xparx

What Emacs version are you using? I think recent versions have changed to call package-initialize before init.el, so you would to have to put the el-get call in early-init.el to get the intended effect.

npostavs avatar Jun 29 '20 19:06 npostavs

Thanks for the answer!

I was going to post a solution but I wasn't confident it was working long term. I apparently got around the problem by reshuffleing the code from the readme into the following

(setq el-get-dir (expand-file-name "el-get" emacs-init-dir))
(add-to-list 'load-path (concat emacs-init-dir "el-get/el-get"))

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

(unless (require 'el-get nil 'noerror)
  (el-get 'sync) ;; Put el-get sync here
  (require 'package)
  (add-to-list 'package-archives
               '("melpa" . "http://melpa.org/packages/"))
  (package-refresh-contents)
  (package-initialize)
  (package-install 'el-get)
  (require 'el-get))

(add-to-list 'el-get-recipe-path (concat emacs-init-dir "recipes"))

I'm not sure this is "THE" solution but it seems to be working.

Xparx avatar Jul 01 '20 15:07 Xparx

I am running GNU Emacs 27.0.91 (build 1, x86_64-w64-mingw32) of 2020-04-20 and was experiencing same issue with org-mode, showing the built-in version.

By moving el-get call to .emacs.d/early-init.el I was able to load the newer version

Org mode version 9.3.7 (release_9.3.7-696-g82b496 @ c:/home/.emacs.d/el-get/org-mode/lisp/)

I am sure it would be useful for others to have this detailed somewhere in README.md.

priyadarshan avatar Jul 24 '20 15:07 priyadarshan