0

Every time I open emacs, I get the following error; emacs is working fine, but not giving me the initial help screen:

An error has occurred while loading `/Users/thorkamphefner/.emacs.d/init.el':

File error: Cannot open load file, package

To ensure normal operation, you should investigate and remove the
cause of the error in your initialization file.  Start Emacs with
the `--debug-init' option to view a complete error backtrace.

When I enter debug mode, I get the following prompt, which I'm not sure how to read. Line 44 in my init file looks like it has nothing to do with the error described.

Debugger entered--Lisp error: (file-error "Cannot open load file" "package")
  require(package)
  eval-buffer(#<buffer  *load*> nil "/Users/thorkamphefner/.emacs.d/init.el" nil t)  ; Reading at buffer position 44
  load-with-code-conversion("/Users/thorkamphefner/.emacs.d/init.el" "/Users/thorkamphefner/.emacs.d/init.el" t t)
  load("/Users/thorkamphefner/.emacs.d/init" t t)
  #[nil "^H\205\276^@   \306=\203^Q^@\307^H\310Q\202A^@ \311=\2033^@\312\307\313\314#\203#^@\315\202A^@\312\307\313\3$
  command-line()
  normal-top-level()

migrated from superuser.com Aug 7 at 7:28

This question came from our site for computer enthusiasts and power users.

  • Reading at buffer position 44 doesn't mean line. To go to the position with the problem, open your init.el and use M-x goto-char 44. – AltruisticDelay Aug 7 at 7:57
  • What version of Emacs do you have? It seems strange that it can't find package which has been built-in since Emacs 24. – npostavs Aug 7 at 10:03
  • M-x goto-char 44 <ret> puts me at the end of (require 'package), which is followed by some add-to-lists. – Thor Kamphefner Aug 7 at 10:34
  • I have version 26.2 – Thor Kamphefner Aug 7 at 10:35
  • 3
    What you could do to try to understand what's going on is: C-h v load-path. This will open help buffer listing all locations where Emacs looks for its ELisp sources. This may be a long list, depending on your config. Not sure what the default location on Mac would be, but look in this list for something like emacs/26.2/lisp or emacs/26.2/site-lisp etc. This is where your missing package should be. – wvxvw Aug 7 at 12:45

Your Answer

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

Browse other questions tagged or ask your own question.