How do I install libraries and fix missing library errors?

If you see an error like No such file or directory for a header file (for example #include <Something.h>), Arduino IDE cannot find the library.

Fix 1: Use Library Manager (recommended)

  1. Open Tools > Manage Libraries...
  2. Search for the library name.
  3. Click Install.

This is the safest approach because it installs to the correct folder and handles updates.

Fix 2: Install a ZIP library

  1. Download the library as a ZIP.
  2. In Arduino IDE: Sketch > Include Library > Add .ZIP Library...
  3. Select the ZIP.

Avoid manually unzipping into random folders. Arduino IDE expects libraries in a specific directory.

Common pitfalls

  • Wrong board core: ESP32 libraries often require the ESP32 board package installed.
  • Multiple copies: Having two versions of the same library can cause strange compile errors.
  • Bad include name: The library folder name and include file name do not always match.
  • Restart required: Sometimes you need to restart Arduino IDE after installing a library.
Bottom line

Install libraries using Library Manager whenever possible. If you must use a ZIP, install it through Arduino IDE, not by dragging folders around.

Related: Why can't I upload code? · What does this error message mean? · How do I install Arduino IDE and drivers?