Replace calls to `which` with Python `os` funcs