Separate out logic to find correct python executable, and change to not do shell call with subprocess