Put `.frozen` before `lib/` in `sys.path` only if necessary, and only if both are in `sys.path`. This allows testing of non-frozen libraries in `/`, and does not adjust the path if `.frozen` is already before `/lib`.
To use in CircuitPython, simply install the [Adafruit CircuitPython bundle](https://github.com/adafruit/Adafruit_CircuitPython_Bundle).
Read the [docs](http://circuitpython.readthedocs.io/projects/whateverthecpxurlis/en/latest/) for info on how to use it.