Development adding library requirement

Hey, question about updating and importing a new library onto the pio for development purposes. I was trying to import filterpy so I added filterpy==1.4.5 to requirements.txt, pushed it to my repo and used pio update app --repo myrepo -b branch. Got some dependency errors afterwards so I checked the requirements.txt file via ssh and the filterpy==1.4.5 line wasnt there. I checked other files that I changed with this update and they had updated correctly.

Is the update command not touching the requirements.txt file?

Are the library requirements only meant to be run with initial software install, not updates?

Maybe I am missing something here but how would you add a library to be installed on the pio. I ended up taking the manual route and ssh-ing → pip install filterpy but would be good to know how to navigate the update/library dependencies for the future and when I inevitably brick my code and have to do a clean install.

On an unrelated note got the ukf running well instead of the ekf.

Python installations with pip don’t look at requirements.txt (by default). Dependencies should go into the setup.py file instead. You should also add them to requirements.txt, but only so another user can do something like pip install -r requirements.txt to install specific dependencies for development, etc. See answer here.

I’m not sure why requirements.txt didn’t update on your machine - I’m actually surprised there is a requirements.txt there in the first place.

Maybe I am missing something here but how would you add a library to be installed on the pio.

You solution, to ssh in and pip install, is how we would recommend installing custom libraries usually. However, in your case, adding it to setup.py makes more sense since you are working at the whole-project level.

1 Like