1

I'm getting this error whenever I try to open Emacs:

Debugger entered--Lisp error: (file-missing "Cannot open load file" "No such file or directory" "counsel")
  require(counsel)
  ivy-rich-set-display-transformer(backup)
  ivy-rich-mode(1)
  (condition-case err (ivy-rich-mode 1) ((debug error) (funcall use-package--warning13 :init err)))
  (progn (condition-case err (ivy-rich-mode 1) ((debug error) (funcall use-package--warning13 :init err))) (if (not (require 'ivy-rich nil t)) (display-warning 'use-package (format "Cannot load %s" 'ivy-rich) :error)))
  (lambda nil (progn (condition-case err (ivy-rich-mode 1) ((debug error) (funcall use-package--warning13 :init err))) (if (not (require 'ivy-rich nil t)) (display-warning 'use-package (format "Cannot load %s" 'ivy-rich) :error))))()
  eval-after-load(ivy (lambda nil (progn (condition-case err (ivy-rich-mode 1) ((debug error) (funcall use-package--warning13 :init err))) (if (not (require 'ivy-rich nil t)) (display-warning 'use-package (format "Cannot load %s" 'ivy-rich) :error)))))
  (condition-case err (eval-after-load 'ivy #'(lambda nil (progn (condition-case err (ivy-rich-mode 1) ((debug error) (funcall use-package--warning13 :init err))) (if (not (require ... nil t)) (display-warning 'use-package (format "Cannot load %s" ...) :error))))) ((debug error) (funcall use-package--warning13 :catch err)))
  eval-buffer(#<buffer  *load*> nil "/home/apoorv/.emacs.d/init.el" nil t)  ; Reading at buffer position 10649
  load-with-code-conversion("/home/apoorv/.emacs.d/init.el" "/home/apoorv/.emacs.d/init.el" t t)
  load("/home/apoorv/.emacs.d/init" noerror nomessage)
  startup--load-user-init-file(#f(compiled-function () #<bytecode 0x1579fa7368c5>) #f(compiled-function () #<bytecode 0x1579fa731b9d>) t)
  command-line()
  normal-top-level()

I have my configuration as a org document, this the block that installs counsel,

  (use-package counsel
    :init
    :bind (("M-x" . counsel-M-x)
           ("C-x b" . counsel-ibuffer)
           ("C-x C-f" . counsel-find-file)
           ("C-M-j" . 'counsel-switch-buffer)
           :map minibuffer-local-map
           ("C-r" . 'counsel-minibuffer-history))
    :custom
    (counsel-linux-app-format-function #'counsel-linux-app-format-function-name-only)
    :config
    (counsel-mode 1)
    (setq ivy-initial-inputs-alist nil))  ;; Don't start searches with ^

I also tried installing counsel manually by M-x package-install but it didn't help either.

3
  • emacs.stackexchange.com/tags/elisp/info
    – Drew
    May 14, 2021 at 19:56
  • 1
    I think you need a line :ensure t in that use-package stanza for it to install counsel. May 14, 2021 at 23:00
  • I was installing ivy and ivy-rich also, and for ivy-rich I had a :after ivy. I changed it to :after counsel it seem to have fixed it. But I'm not sure.
    – apoorv569
    May 15, 2021 at 13:38

1 Answer 1

1

I'd recommend purging your elpa directory, and then restarting emacs:

$ cd ~/.emacs.d/elpa
$ rm -rf *
$ emacs

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.