1

I installed auto-complete by M-x list-packages, navigating to the auto-complete package, and hit the Install button. The emacswiki page says that doing so will configure the load-path so auto-complete.el will be loaded correctly.

I have this in my init.el

(require 'auto-complete) (global-auto-complete-mode t)

and emacs gives the following error: File error: Cannot open load file, not a directory, auto-complete

I tried adding the directory containing auto-complete.el to the load-path but it still gives me the same error.

  • 2
    You should need to manually update the load-path if you are installing packages using the package manager (like you do using M-x list-packages). I would recommend removing all instances of you manually updating the load-path and then see if the issue persists after restarting emacs. If the issue is still there, see if you can recreate the problem in an emacs -Q session. Also, you need to have (package-initialize) in your config. – Kaushal Modi Jan 31 '16 at 4:47
  • According to emacswiki.org/emacs/LoadPath, load-path is automatically configured to handle packages installed with the package manager. – user90593 Jan 31 '16 at 4:55
  • Sorry, that was a big typo on my part, I meant that you shouldn't need to manually update. – Kaushal Modi Jan 31 '16 at 4:56
  • (package-initialize) fixed it! – user90593 Jan 31 '16 at 5:00
  • If you are getting that error at emacs startup, try starting emacs as usual but with --debug-init option at the command line. And then you can paste here (update your question with) the error backtrace you get. – Kaushal Modi Jan 31 '16 at 5:00
1

As discussed in the comments, the solution is to ensure that (package-initialize) is in the emacs config.


From the Package Installation section of the emacs Manual,

In some circumstances, you may want to load packages explicitly in your init file (usually because some other code in your init file depends on a package). In that case, your init file should call the function package-initialize.

I would say that in almost all circumstances it would be needed to have (package-initialize) in the very beginning of the user's init file.

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.