Libraries Errors

I've gotten myself in something of a mess with installing a new library.

I installed the library .ZIP file fine, but unfortunately the wrong files were in the .ZIP file so it generated up a bunch of error messages. I couldn't see a way to delete or update a contributed library from the library manager, so I just deleted this library sub-folder in the arduino/libraries folder.

I assumed that when the IDE loaded again it looked at the arduino/libraries folder to see what libraries were included and, not finding the folder, it wouldn't show up on the list of contributed libraries. It appears I was wrong. It's still showing the contributed library that I deleted. When I try to reload the library (this time with the correct files in the .ZIP file), it tells me that the library is already present, so it won't reload it.

In the Library manager it's just listed as "unknown version INSTALLED" with no update or delete option.

Question: How do I tell IDE or library manager that the contributed library it thinks is there isn't there so I can install the correct version (with the same name). How do I fully remove that library so that I can start again?

If I understand you correctly, and you're on a Windows machine. I think you can remove the folder under my documents/arduino/libraries. Then reinstall it.

Thank you!

That did the trick. Is there an approved method of removing contributed libraries that doesn't require directly manually deleting files form various directories? Adding a library is a one click process from IDE but I couldn't find any similar way to remove a contributed library.

Thanks again for the tip.

KA1GT: Thank you!

That did the trick. Is there an approved method of removing contributed libraries that doesn't require directly manually deleting files form various directories? Adding a library is a one click process from IDE but I couldn't find any similar way to remove a contributed library.

Thanks again for the tip.

I had a similar issue and couldn't find any method to remove a library using the IDE. I guess the developers never saw a need to make it easy to remove a library. Not that deleting the folder is difficult.

There's no way to do it from the Arduino IDE unfortunately. The feature has been requested: https://github.com/arduino/Arduino/issues/2878 The reason the developer gave for not implementing it is that they didn't know how to delete the file to the Recycle Bin so this would make it possible that people would accidentally permanently delete irreplaceable custom libraries that they had written or modified.

It does sound like they would be possibly interested in adding that feature if it could be done using the Recycle Bin so if anyone is interested in contributing the feature I think that would be much appreciated by everyone.

It is a problem because I've found that, sadly, many Arduino users don't really understand how to work with files and folders. I find myself very reluctant to recommend beginners to delete anything from their computer because it really opens up a can of worms to try to help them via the forum to recover if they accidentally do something wrong.

pert: There's no way to do it from the Arduino IDE unfortunately. The feature has been requested: https://github.com/arduino/Arduino/issues/2878 The reason the developer gave for not implementing it is that they didn't know how to delete the file to the Recycle Bin so this would make it possible that people would accidentally permanently delete irreplaceable custom libraries that they had written or modified.

It does sound like they would be possibly interested in adding that feature if it could be done using the Recycle Bin so if anyone is interested in contributing the feature I think that would be much appreciated by everyone.

It is a problem because I've found that, sadly, many Arduino users don't really understand how to work with files and folders. I find myself very reluctant to recommend beginners to delete anything from their computer because it really opens up a can of worms to try to help them via the forum to recover if they accidentally do something wrong.

Well, in my case, I actually didn't "delete" the file folder. I simply renamed it from Library_Name to old_Library_Name. I guess it would still be accessible by the IDE if you made a call for it in a sketch. But it does allow for a new install of the original library. Maybe that's something the developers could use?

That will work if the include file matches the library folder name:
#include <Library_Name.h>
because the Arduino IDE uses folder name matching as one of the deciding factors on include priority. However, frequently the library folder name does not match. The most common cause is when you download a library from GitHub it appends the branch name, so the library folder ends up being something like Library_Name-master.

Probably more safe would be to move the libraries to a folder outside the library search path (e.g. {sketchbook}/removed_libraries. If there is already a folder of that name in the pseudo-Recycle Bin folder then some unique identifier should be appended to the library folder name. This would even allow for an “undo” feature if you wanted to get fancy.