Requirements.txt ignored during installation?

Hi all,
i’m trying to develop my first charm (a subordinate app), and i need the “ifaddr” pythton module, so i added it to requirements.txt, then i build and deployed my charm but installation fail cause my code cannot find the ifaddr module.
I did not find any problem installing the package using pip on the same unit.

Any advice?
Thanks and best regards
Flavio

If the charm is written using the Reactive framework, then you could add it in layers.yaml:

includes:
  - 'layer:basic'
options:
  basic:
    packages:
      - python3-ipaddr

(or python-ipaddr if you’re using Python 2)

… and if the charm is written to use the newer operator framework, and built using charmcraft, then it should work by just dropping it in requirements.txt (but then the presence or lack of the dependency would already be evident at build time, not during installation).