It doesn't look like there is really any reason to call this as a subprocess here, and there definitely is a reason /not/ to, since the paths and such can be kind of complicated. Can you just move the code in kb.py here?