"Arduino IDE Unable to Recognize Installed Libraries (LiquidCrystal_I2C.h Not Found)"

I am experiencing issues with the Arduino IDE on my Dell laptop. I am unable to compile any sketches that require external libraries.

For example, I attempted to include the LiquidCrystal_I2C.h library in my code, and I received the following error message:

yaml

fatal error: LiquidCrystal_I2C.h: No such file or directory

Here is the relevant part of the compilation output:

yaml

Alternatives for LiquidCrystal_I2C.h: [LiquidCrystal I2C@1.1.2]
ResolveLibrary(LiquidCrystal_I2C.h)
-> candidates: [LiquidCrystal I2C@1.1.2]
exit status 1
Compilation error: LiquidCrystal_I2C.h: No such file or direct

Hi @rosie2000. I'm going to ask you to provide the full verbose output from a compilation.


:exclamation: This procedure is not intended to solve the problem. The purpose is to gather more information.


Please do this:

  1. Select File > Preferences...(or Arduino > Settings... for macOS users) from the Arduino IDE menus.
    The "Preferences" dialog will open.
  2. Check the box next to "Show verbose output during: ☐ compilation" in the "Preferences" dialog.
  3. Click the "OK" button.
    The "Preferences" dialog will close.
  4. Select Sketch > Verify/Compile from the Arduino IDE menus.
  5. After the compilation fails you'll see a button on the right side of the orange bar in Arduino IDE: Copy error messages. Click that button.
    This copies the full output to the clipboard.
  6. Open a forum reply here by clicking the "Reply" button.
  7. Click the <CODE/> icon on the post composer toolbar.
    This will add the forum's code block markup (```) to your reply to make sure the error messages are correctly formatted.
  8. Press the Ctrl+V keyboard shortcut (Command+V for macOS users).
    This will paste the compilation output into the code block.
  9. Move the cursor outside of the code block markup before you add any additional text to your reply.
  10. Click the "Reply" button to post the output.

In case the output is longer than the forum software will allow to be added to a post, you can instead save it to a .txt file and then attach that file to a reply here.

Click here for attachment instructions

  1. Open any text editor program.
  2. Paste the copied output into the text editor.
  3. Save the file in .txt format.
  4. Open a forum reply here by clicking the "Reply" button.
  5. Click the "Upload" icon (Upload icon) on the post composer toolbar:

    The "Open" dialog will open.
  6. Select the .txt file you saved from the "Open" dialog.
  7. Click the "Open" button.
    The dialog will close.
  8. Click the "Reply" button to publish the post.

Alternatively, instead of using the "Upload" icon on the post composer toolbar as described in steps (5) - (7) above, you can simply drag and drop the .txt file onto the post composer field to attach it.

Welcome to the forum

Please post your sketch, using code tags when you do. This prevents parts of it being interpreted as HTML coding and makes it easier to copy for examination

In my experience the easiest way to tidy up the code and add the code tags is as follows
Start by tidying up your code by using Tools/Auto Format in the IDE to make it easier to read. Then use Edit/Copy for Forum and paste what was copied in a new reply. Code tags will have been added to the code to make it easy to read in the forum thus making it easier to provide help.

Where exactly is LiquidCrystal_I2C.h located on your PC ?

FQBN: arduino:avr:uno
Using board 'uno' from platform in folder: C:\Users\Dell\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6
Using core 'arduino' from platform in folder: C:\Users\Dell\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6

Detecting libraries used...
C:\Users\Dell\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR -IC:\Users\Dell\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino -IC:\Users\Dell\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\variants\standard C:\Users\Dell\AppData\Local\Temp\arduino\sketches\CEB31F2376AC23FB58792132DC632E13\sketch\sketch_nov3a.ino.cpp -o nul
Alternatives for Wire.h: [Wire@1.0]
ResolveLibrary(Wire.h)
  -> candidates: [Wire@1.0]
C:\Users\Dell\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR -IC:\Users\Dell\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino -IC:\Users\Dell\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\variants\standard -IC:\Users\Dell\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\libraries\Wire\src C:\Users\Dell\AppData\Local\Temp\arduino\sketches\CEB31F2376AC23FB58792132DC632E13\sketch\sketch_nov3a.ino.cpp -o nul
Alternatives for LiquidCrystal_I2C.h: [LiquidCrystal I2C@1.1.2]
ResolveLibrary(LiquidCrystal_I2C.h)
  -> candidates: [LiquidCrystal I2C@1.1.2]
C:\Users\Dell\AppData\Local\Temp\.arduinoIDE-unsaved2024103-1204-198p305.k1ma\sketch_nov3a\sketch_nov3a.ino:2:10: fatal error: LiquidCrystal_I2C.h: No such file or directory
 #include <LiquidCrystal_I2C.h>
          ^~~~~~~~~~~~~~~~~~~~~
compilation terminated.
C:\Users\Dell\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR -IC:\Users\Dell\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino -IC:\Users\Dell\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\variants\standard -IC:\Users\Dell\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\libraries\Wire\src -Ic:\Users\Dell\OneDrive\ドキュメント\Arduino\libraries\LiquidCrystal_I2C C:\Users\Dell\AppData\Local\Temp\arduino\sketches\CEB31F2376AC23FB58792132DC632E13\sketch\sketch_nov3a.ino.cpp -o nul
Alternatives for LiquidCrystal_I2C.h: [LiquidCrystal I2C@1.1.2]
ResolveLibrary(LiquidCrystal_I2C.h)
  -> candidates: [LiquidCrystal I2C@1.1.2]
exit status 1

Compilation error: LiquidCrystal_I2C.h: No such file or directory

OK, I see the cause here:

Unfortunately there is a bug in Arduino IDE that causes it to not recognize libraries when they are installed under a path that contains non-ASCII characters (e.g. ドキュメント).

The workaround is to change the location where libraries are stored by Arduino IDE to one that is under a path without any non-ASCII characters. I'll provide instructions you can follow to do that:

  1. Select File > Preferences... from the Arduino IDE menus.
    The "Preferences" dialog will open.
  2. Set the path in the "Sketchbook location" preference to a location that does not contain any non-ASCII characters in its path.
  3. Click the "OK" button.
    The "Preferences" dialog will close.
  4. Move the contents of the folder at the previous path of the "Sketchbook location" preference (C:\Users\Dell\OneDrive\ドキュメント\Arduino) to the new location.

Thank you so much. It's working now.

You are welcome.

Regards, Per