from pip_api._call import call def version() -> str: result = call("--version") # result is of the form: # pip from (python ) return result.split(" ")[1]