(*, verbosity=0)
return _run_pip([*args, *reversed(_PACKAGE_NAMES)])
Helper to support a clean default uninstall process on Windows

    Note that calling this function may alter os.environ.
Helper to support a clean default uninstall process on Windows
Helper to support a clean default uninstall process on Windows
def _uninstall_helper(*, verbosity=0):
    """Helper to support a clean default uninstall process on Windows

    Note that calling this function may alter os.environ.
    """
    # Nothing to do if pip was never installed, or has been removed
    try:
        import pip
    except ImportError:
        return

    # If the installed pip version doesn't match the available one,
    # leave it alone
    available_version = version()
    if pip.__version__ != available_version:
        print(f"ensurepip will only uninstall a matching version "
              f"({pip.__version__!r} installed, "
              f"{available_version!r} available)",
              file=sys.stderr)
        return

    _disable_pip_configuration_settings()

    # Construct the arguments to be passed to the pip command
    args = ["uninstall", "-y", "--disable-pip-version-check"]
    if verbosity:
        args += ["-" + "v" * verbosity]

    return _run_pip([*args, *reversed(_PACKAGE_NAMES)])
def _uninstall_helper ( * , verbosity = 0 ) : # Nothing to do if pip was never installed, or has been removed try : import pip except ImportError : return # If the installed pip version doesn't match the available one, # leave it alone available_version = version ( ) if pip . __version__ != available_version : print ( f"ensurepip will only uninstall a matching version " f"({pip.__version__!r} installed, " f"{available_version!r} available)" , file = sys . stderr ) return _disable_pip_configuration_settings ( ) # Construct the arguments to be passed to the pip command args = [ "uninstall" , "-y" , "--disable-pip-version-check" ] if verbosity : args += [ "-" + "v" * verbosity ] return _run_pip ( [ * args , * reversed ( _PACKAGE_NAMES ) ] )