Arduino 1.8 and 2.0 manage libraries folders

Hello,
is it possible to have a different library managment between two (or more) arduino ide ?
I downloaded the 2.0.3 IDE .zip, run it and automatically it detects the libraries installed with the 1.8.19 version.
Is it possible to have different library folders (one for each IDE version) ?
Thanks, Giorgio

Only if you have a different sketchbook directory; I think that it's possible but can't verify at the moment.

Alternative is to create a portable install of 1.8.x. That is completely stand alone and it will use its own libraries directory. There is currently no portable Installation posdoble with IDE2.0.

Welcome to the forum

Why do you want to do this ?

This is correct. Arduino IDE 1.x and 2.x use separate preference stores so you are free to set a different sketchbook location for each IDE version series.

I'll provide instructions:

  1. Select File > Preferences from the Arduino IDE menus.
  2. Set the "Sketchbook location" preference to any convenient location on your computer that is separate from the sketchbook location used by the other IDE version.
  3. Click the "OK" button.

It is necessary to close all IDE windows and then restart the IDE when using Arduino IDE 2.0.3 after changing the "Sketchbook location" preference before the IDE will fully recognize the changed preference. This defect was fixed recently, so it will not be necessary for users of future releases of the IDE, but it is still required for users of the current and previous Arduino IDE 2.x releases.

The reason the separation of libraries are accomplished by changing the sketchbook location is because the IDE uses the libraries located in the libraries subfolder of the sketchbook folder. This is where the Arduino IDE "Library Manager" and "Add ZIP Library" features installs libraries to, and likely the location where manual installations of libraries should be made as well. However, there are also several other sources of libraries separate from the ones in the libraries subfolder of the sketchbook:

  • "Platform bundled" libraries are included with the installation of the boards platforms you install via the Arduino Boards Manager.
    Both Arduino IDE 1.x and 2.x use the same location for these installations, so will share the same platform bundled libraries. It is probably not a problem for you, but worth noting. If it is a problem, it is possible to set separate locations and I can provide instructions for that, but I recommend against it unless you have a very good reason for doing so.
  • "Built-in" libraries are the fundamental libraries (e.g., Keyboard, Servo) included with the Arduino IDE installation.
    Arduino IDE 2.x and 1.x use separate locations for the installations of the built-in libraries by default so no action is needed to accomplish your goal for these libraries.

Thanks to all!
Ok for the library, I will try.
Is it possible to do the same thing with the board manager?
Is it possible to have different board manager between the 1.x and 2.x?
I use IDE 1.8.19 with ESP32 TTGO T1 display, if I update the board library to 2.0.6 it does not work
I want to use IDE 2.0.3 with 2.0.6 board library and 1.8.19 with ESP32 1.0.6 board library

Regards, Giorgio

Yes. The easiest way to accomplish this is by putting Arduino IDE 1.x into "portable mode". There are instructions for doing that here:

This will cause Arduino IDE 1.x to install and use the boards platforms in the portable/packages subfolder of the Arduino IDE 1.x installation folder. Arduino IDE 2.x will continue to use the boards platforms from the default location.

Portable mode is not available if you are using macOS or the Microsoft Store app version of Arduino IDE. In case this solution is not suitable for you for that reason or some other reason, there is an alternative solution of configuring Arduino IDE 2.x to use an arbitrary location for boards platforms. I can provide instructions for that.


But I do think it would be good for you to answer UKHeliBob's question:

It is more convenient and more efficient to use the same libraries and boards platforms for all your IDE versions. Except for some very rare exceptions, libraries and boards platforms will work with either IDE version. Even in those cases where there is an incompatibility, it is usually fairly easy to resolve or work around it.

It is very interesting to discuss the ways to achieve a separation between the dependencies stores of the two IDE versions, but you should only actually do that if you have a good reason. If you share that reason with us, we might be able to help you to find an alternative approach that allows the sharing of the libraries and boards platforms.

Because if I use 1.8.19 IDE and TTGO T1 display ESP32 the 2.0.6 ESP boards library (the lastest) it does not work (i don't know why...). I need to use the 1.0.6 board library.
It seems that the newer ESP32 (for example the S3 model) needs the 2.0.6 board library and 2.x IDE to work.

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