Library directories - can I get rid of some?

I keep all my Applications directories in partition 'D' and my Data in 'E' - data includes my sketches.

I'm getting bother with Invalid Library files messages and decided to find out why.

I see that with the current releases of the Arduino IDE, that the Library sub-directory should be in the Sketchbook folder. Yep, I've got that, but I also have :-

D:\Arduino\libraries

E:\Arduino\libraries

E:\Arduino\Arduino data\libraries

So I have 4 sets of library files.

The error message is "Invalid library found in D:\Arduino\libraries\libraries: D:\Arduino\libraries\libraries"

Can someone tell me how to sort this out please.

robgraham:
I keep all my Applications directories in partition 'D' and my Data in 'E' - data includes my sketches.

D:\Arduino\libraries

E:\Arduino\libraries

E:\Arduino\Arduino data\libraries

So I have 4 sets of library files.

Some of those are not being used. There are actually a couple other libraries folders that you haven't listed but let's ignore those for the sake of simplicity. There are the bundled libraries which are located in the libraries folder under the Arduino IDE installation folder and the sketchbook libraries which are located in the libraries folder under the sketchbook folder. So two of the folders on that list are doing nothing but confusing you. If there are useful libraries in them copy them to the {sketchbook}\libraries folder and then delete those folders.

robgraham:
"Invalid library found in D:\Arduino\libraries\libraries: D:\Arduino\libraries\libraries"

Can someone tell me how to sort this out please.

If there are useful libraries inside D:\Arduino\libraries\libraries then move them to {sketchbook}\libraries folder and then delete D:\Arduino\libraries\libraries.

Many thanks,Pert

I take it that if I do delete some of these library files, I will be able to restore them from somewhere if I later find they are necessary? And then, I'm pretty near the bottom of the learning curve as yet, so will something tell me when a library file is missing ?

Thanks again
Rob

robgraham:
if I do delete some of these library files, I will be able to restore them from somewhere if I later find they are necessary?

If you accidentally delete any of the bundled libraries they you can get them back by reinstalling the Arduino IDE. If you accidentally delete a 3rd party library then you should be able to download it from wherever you got it in the first place and reinstall as long as it hasn't disappeared from the internet in the meantime. If you have a library that you wrote or customized yourself then it's possible you could delete the only copy in existence so be careful of that. If in doubt just save a backup of those folders before deleting them. Since they aren't actually being used by the Arduino IDE it's unlikely you will miss them.

robgraham:
will something tell me when a library file is missing ?

Yes. The way you add a library to a sketch is by doing something like:

#include <Library.h>

Where Library.h is the library name. If Library.h is missing you will get an error message something like:

C:\Users\per\AppData\Local\Temp\arduino_modified_sketch_92422\sketch_may22b.ino:1:21: fatal error: Library.h: No such file or directory

 #include <Library.h>

                     ^

compilation terminated.

exit status 1
Error compiling for board Arduino/Genuino Micro.

when you try to verify or upload your sketch.