Fatal error: Adafruit_NeoPixel.h: No such file or directory but I have it

Hi, I'm Lesha. I have a problem that Arduino doesn't see my module, when it colors module orange. I just don't understand why, so help me please <3.
Error:

Arduino: 1.8.12 (Windows 10), Board: "Arduino Uno"

swanky_juttuli1:1:10: fatal error: Adafruit_NeoPixel.h: No such file or directory

 #include <Adafruit_NeoPixel.h>

          ^~~~~~~~~~~~~~~~~~~~~

compilation terminated.

exit status 1
Adafruit_NeoPixel.h: No such file or directory

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

A proof that Arduino sees the module AND DOESN'T SEE IT IN ONE TIME:


Please help me

Thats NOT how you use a library!

Try Library Manager ( Sketch >> Include Library >> Manage Libraries ) to add it to the IDE.

hi @LeshaTheBeginner
Did you explicitly installed the library to your PC or just add the line

to the code?

The color of the syntax highlighting is not prove that the library is installed.


All my library collection is on this photo. So yeah, I installed them

I did that 10 times (literally) and it didn't help.. But thanks for trying to help me.

@missdrew What do you mean???

Thats NOT how you use a library!

I just don't understand.

Hi @LeshaTheBeginner. I'm going to ask you to provide some additional information that might allow us to determine the cause of the problem.


:exclamation: NOTE: These instructions will not solve the problem. They are only intended to gather more information which might provide a clue that eventually leads to a solution.


Please do this:

  1. Select File > Preferences from the Arduino IDE menus.
  2. Check the box next to "Show verbose output during: ☐ compilation".
  3. Click the OK button.
  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 the 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 </> 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.
    Code block
  8. Press Ctrl+V.
    This will paste the compilation output into the code block.
  9. Move the cursor outside of the code tags 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:

  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 (image) on the post composer toolbar:
    image
  6. Select the .txt file you saved.
  7. Click the Open button.
  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.

Remove(delete) the tab with the ```
Adafruit_NeoPixel.h

Arduino: 1.8.12 (Windows 10), Board: "Arduino Uno"

D:\Arduino\arduino-builder -dump-prefs -logger=machine -hardware D:\Arduino\hardware -tools D:\Arduino\tools-builder -tools D:\Arduino\hardware\tools\avr -built-in-libraries D:\Arduino\libraries -libraries C:\Users\lesha\OneDrive\Документы\Arduino\libraries -fqbn=arduino:avr:uno -ide-version=10812 -build-path C:\Users\lesha\AppData\Local\Temp\arduino_build_935799 -warnings=none -build-cache C:\Users\lesha\AppData\Local\Temp\arduino_cache_490854 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.avr-gcc.path=D:\Arduino\hardware\tools\avr -prefs=runtime.tools.avr-gcc-7.3.0-atmel3.6.1-arduino5.path=D:\Arduino\hardware\tools\avr -prefs=runtime.tools.arduinoOTA.path=D:\Arduino\hardware\tools\avr -prefs=runtime.tools.arduinoOTA-1.3.0.path=D:\Arduino\hardware\tools\avr -prefs=runtime.tools.avrdude.path=D:\Arduino\hardware\tools\avr -prefs=runtime.tools.avrdude-6.3.0-arduino17.path=D:\Arduino\hardware\tools\avr -verbose C:\Users\lesha\OneDrive\Документы\Arduino\sketch_dec24a\sketch_dec24a.ino
D:\Arduino\arduino-builder -compile -logger=machine -hardware D:\Arduino\hardware -tools D:\Arduino\tools-builder -tools D:\Arduino\hardware\tools\avr -built-in-libraries D:\Arduino\libraries -libraries C:\Users\lesha\OneDrive\Документы\Arduino\libraries -fqbn=arduino:avr:uno -ide-version=10812 -build-path C:\Users\lesha\AppData\Local\Temp\arduino_build_935799 -warnings=none -build-cache C:\Users\lesha\AppData\Local\Temp\arduino_cache_490854 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.avr-gcc.path=D:\Arduino\hardware\tools\avr -prefs=runtime.tools.avr-gcc-7.3.0-atmel3.6.1-arduino5.path=D:\Arduino\hardware\tools\avr -prefs=runtime.tools.arduinoOTA.path=D:\Arduino\hardware\tools\avr -prefs=runtime.tools.arduinoOTA-1.3.0.path=D:\Arduino\hardware\tools\avr -prefs=runtime.tools.avrdude.path=D:\Arduino\hardware\tools\avr -prefs=runtime.tools.avrdude-6.3.0-arduino17.path=D:\Arduino\hardware\tools\avr -verbose C:\Users\lesha\OneDrive\Документы\Arduino\sketch_dec24a\sketch_dec24a.ino
Using board 'uno' from platform in folder: D:\Arduino\hardware\arduino\avr
Using core 'arduino' from platform in folder: D:\Arduino\hardware\arduino\avr
Detecting libraries used...
"D:\\Arduino\\hardware\\tools\\avr/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=10812 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-ID:\\Arduino\\hardware\\arduino\\avr\\cores\\arduino" "-ID:\\Arduino\\hardware\\arduino\\avr\\variants\\standard" "C:\\Users\\lesha\\AppData\\Local\\Temp\\arduino_build_935799\\sketch\\sketch_dec24a.ino.cpp" -o nul
Alternatives for Adafruit_NeoPixel.h: [Adafruit_NeoPixel@1.10.7]
ResolveLibrary(Adafruit_NeoPixel.h)
  -> candidates: [Adafruit_NeoPixel@1.10.7]
"D:\\Arduino\\hardware\\tools\\avr/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=10812 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-ID:\\Arduino\\hardware\\arduino\\avr\\cores\\arduino" "-ID:\\Arduino\\hardware\\arduino\\avr\\variants\\standard" "-IC:\\Users\\lesha\\OneDrive\\Документы\\Arduino\\libraries\\Adafruit_NeoPixel" "C:\\Users\\lesha\\AppData\\Local\\Temp\\arduino_build_935799\\sketch\\sketch_dec24a.ino.cpp" -o nul
Alternatives for Adafruit_NeoPixel.h: [Adafruit_NeoPixel@1.10.7]
ResolveLibrary(Adafruit_NeoPixel.h)sketch_dec24a:1:10: fatal error: Adafruit_NeoPixel.h: No such file or directory


  -> candidates: [Adafruit_NeoPixel@1.10.7]compilation terminated.


Using library Adafruit_NeoPixel at version 1.10.7 in folder: C:\Users\lesha\OneDrive\Документы\Arduino\libraries\Adafruit_NeoPixel 
exit status 1
Adafruit_NeoPixel.h: No such file or directory

swanky_juttuli1.ino (1.2 КБ)

@LeshaTheBeginner I need the verbose compilation output. Please make sure you followed steps 1-3 in the instructions from my previous reply.

@ptillisch I changed my output. Now here's the compilation output.

Thanks! I was looking for something exceptional in the path of the library, and I do see something that might be the cause:

I remember a problem with library discovery in paths that contain extended (not sure that is the right term) characters as you have in the Документы folder name. Unfortunately I can't seem to find the bug report about that. I don't remember whether it has been fixed already (you are using a significantly outdated version of Arduino IDE). I just tried reproducing the error and was not able to even using Arduino IDE 1.8.12 like you. But I am on my Linux machine right now and it might well be Windows-specific.

I don't have access to a Windows machine right now due to a power outage at my location but I will try to investigate this later once the power is restored. I thought I should go ahead and post my current hypothesis now in case it might be useful to any ongoing discussion in the meantime.

If you want to run some experiments:

  • Determine whether the path is the cause by changing the "Sketchbook location" preference to a different path containing only ASCII characters in the Arduino IDE preferences, reinstall the library, then try compiling the sketch again.
  • Determine whether the bug was fixed already by installing the latest version of Arduino IDE and trying to compile the sketch with the "Sketchbook location" set to the current path (C:\Users\lesha\OneDrive\Документы\Arduino).

I was able to reproduce the bug on my Windows machine. Unfortunately I found it still occurs even with the latest version Arduino IDE 2.0.3.

The bug is being tracked by the Arduino developers here:

Arduino IDE absolutely should support any valid path, but for now we must make the best of the software we have and use a workaround for the bug. The workaround is to configure the IDE to use a sketchbook location that has only ASCII characters in the path. I'll provide instructions:

  1. Select File > Preferences from the Arduino IDE menus.
  2. Click the "Browse" button to the right of the "Sketchbook location" preference field.
  3. In the ""Select new sketchbook location" dialog that opens, select any folder on your computer that is under a path that contains only ASCII characters (e.g., C:\Users\lesha\Documents\Arduino)
  4. Click the "Open" button in the ""Select new sketchbook location" dialog.
  5. Click the "OK" button in the "Preferences" dialog.

The libraries are installed under the sketchbook folder, so changing the "Sketchbook location" preference will cause all the libraries you installed before to no longer be accessible to Arduino IDE. From your screenshot, I see you don't have very many libraries. So it might be easiest to just use Arduino Library Manager (Sketch > Include Library > Manage Libraries...") to reinstall the libraries you need. Alternatively, you can use Windows "File Explorer" to copy the folders from the old sketchbook location to the new location.


Please let me know if you have any questions or problems while following those instructions.

Not quite true; it depends on what is in that Adafruit_NeoPixel directory. So make sure that that directory is correctly populated; it should at least contain the file Adafruit_NeoPixel.h. Below a screenshot of what it should look like.

image

There seems to be a common problem with library detection when using OneDrive; I do not know why.

You can try to create a "normal" install directly on the C drive (any other drive on your system will probably also work),

  1. Under file → preferences in the IDE, change the sketchbook directory to C:\Users\lesha\Documents\Arduino.
  2. Navigate to that directory using windows explorer and create a directory libraries.
  3. Restart the IDE; just for good measure.
  4. Install the library, either using library manager or copying the directory Adafruit_Neopixel from OneDrive to the new libraries` directory.

I also would have suspected OneDrive if not for the presence of the folder named Документы, but I was able to reproduce the bug with a sketchbook location under a folder named Документы that was not on OneDrive so I don't think OneDrive is the culprit this time. It is possible we have a "problem stack" where either OneDrive or the Документы folder name will break the IDE, but I would suggest focusing exclusively on the known problem with the Документы folder name for now.

@ptillisch Документы this is from ukranian Documents.
@sterretje Thanks for Solving problem. The problem was in OneDrive.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.