PlatformIO Community

How integrate external personal .zip libraries

Hello everyone. In the previous version of PlatformIO, was an option at library menu that calls “install” which allows to install our external .zip libraries. It was great, because it made so so easy import libraries

image

But it disappeared with the update.

image

How I can install that libraries now? Where is that action button now?

Thanks a lot

I think the removal of that button is deliberate to push users to use the correct library management, that is, per-project managements via lib_deps instead of global libraries, which bring a bunch of problems with them (@ivankravets correct me if I’m wrong). So I strongly recommend that you use the intended PlatformIO library management system, which is already so easy by searching for the library you want and adding it via the “Add to Project” button.

grafik

Installing global libraries is still possible (but unrecommended) via the commandline. Open a PlatformIO CLI and execute the command

pio lib -g install path_to_zip_file

example:

pio lib -g install "C:\Users\Max\Downloads\Adafruit-GFX-Library-master.zip"
2 Likes

Ok, thats fine… There are any ways to implemets my external libraries “C:/…” by command line BUT as local and no like global?

My problem isn’t with local or global (I think that is better as now), my problem is at time to integrate my own .zip libraries. If I could implemets my own external libraries as local I would like know it :grinning:

Omitting the -g (=--global) will install the library in the local project storage and modify your platformio.ini to include the path ot that library.

Example:

pio lib install C:\Users\Max\Downloads\Adafruit-GFX-Library-master.zip
>pio lib install C:\Users\Max\Downloads\Adafruit-GFX-Library-master.zip
Library Storage: C:\Users\Max\Documents\PlatformIO\Projects\atmel_hello\.pio\libdeps\uno
Library Manager: Installing file://C:\Users\Max\Downloads\Adafruit-GFX-Library-master.zip
Library Manager: Adafruit GFX Library @ 1.10.3 has been installed!
Library Manager: Installing dependencies...
Library Manager: Installing Adafruit BusIO
Library Manager: Adafruit BusIO @ 1.6.0 has been installed!

platformio.ini before

[env:uno]
platform = atmelavr
board = uno
framework = arduino

after

[env:uno]
platform = atmelavr
board = uno
framework = arduino
lib_deps = C:\Users\Max\Downloads\Adafruit-GFX-Library-master.zip

You see that that command line is just a fancy way of using the lib_deps directive as I have already linked with its documentation above – have a read through that, please.

You can also use the lib_extra_dirs option if you just want to point to an existing library folder on disk.

1 Like

And… You are running CLI instruction from project’s windows (terminal with project open)

1 Like

Exactly, the pio install commands will use the current directory and check for a PlatformIO project there.

I must use platformio lib install ... , doesn’t work with pio lib install ....