switched from bash to 100% python, everything works great now