PlatformIO Community

Libraries "Install to..." wrong folder

Hi,
I modify most of the libraries per project use, therefore, I have to have them separate in the project folder. However, since a new version (I stopped using PlatformIO for a couple of months) and PlatformIO Library (Install to…) is “folder locked” after the first install to always saves libraries to the same folder (wrong folder, wrong project). Even reinstall (VSC + PlatformIO) do not help. This problem affecting a new project, old inspected projects and manually converted projects (.piolibdeps (move to)-> .pio/libdeps/[env_name]).
Is there anyone to help with it, is it a bug?
Thank you.

Not quite sure what you mean there…

.piolibdeps (move to)-> .pio/libdeps/[env_name]

… is expected behaviour as of PlatformIO v4… it now has both build and PIO managed libraries under the one .pio folder.

As to why it’s installing libraries to the wrong project, I can say, as I don’t usually use the GUI to install libraries, and specifiy them directly in the projects platformio.ini.

What I can see from a quick look at it is that if you haven’t opened the project via PIO Home, it doesn’t get listed at the bottom of the main screen under Recent Projects, and also doesn’t appear to show up in the Install to... projects list… maybe give that a try to ‘refresh’ what projects PIO Home knows about? When the PIO Home Project Configurator is out of beta, it will be easier to manage that, but for now that is probably what’s needed?

Edit: Another aspect seems to be that a newly created project isn’t added to that list… so if you’ve just created a new project, it doesn’t appear in the ‘recent projects’ or ‘install to…’ lists! :open_mouth:

Thank you pfeerick for your help.
Install to… showing properly location/name projects. Unfortunately, regardless which one I use it always choose the one directory. Moreover, it is not consistent: in one pc its save to another project directory - making a mess, on another one is putting all lib folders in the [user]/.platformio/penv/Scripts/.pio/libsdev/[env_name]?!?, eventually creating different folders with [env_name].
Booth working similar to global as you can load only one library (regardless of the project you chose)!
Moreover, as I mentioned before, most of my libraries are modified, therefore, it needs to be loaded manually (not auto in platformio.ini).
regarding “.piolibdeps (move to)-> .pio/libdeps/[env_name]” this is instruction (on this forum) how to convert old project into new project: .piolibdeps folder
Cheers.

Have you got the same version of platformio on both machines? i.e. what’s shown at the front page of platformio home?

image

For information re migrating from 3.x to 4.x… there’s also the specific documentation page for that.

The one that’s putting stuff in [user]/.platformio/penv/Scripts/.pio/libsdev/[env_name] sounds like it is bugged… might be best to delete the [user]/.plaformio when VSCode isn’t running and let the PlatformIO extension trigger a clean re-install on that machine.

I have the newest VSC and newest PlatformIO as per your picture. As mentioned I already reinstall both. The same problem is with a newly created project, I just mention old projects as it is also affected.
Regarding delete folder do you suggest that I shall delete existing working project where libraries are saved? Regarding second PC I have limited access and I cannot experiment with deleting folders.
You seem very helpful, will you test this problem on your site in this way:
Create the first project, save the library to… first project, close it, open second and install to… second project same library, isn’t say already installed (because saving to the same directory)? I can see when is saving libraries its create file (still wrong directory) [env_name].lock (in my case is waveshare_ble400.lock).
Moreover, if I create a new project I have to run Inspect it (compiling ok) to see a project on the list when install to…
Thanks.