Install plugin packages based on specified Conda channels.

    .. versionchanged:: 0.19.1
        Do not save rollback info on dry-run.

    .. versionchanged:: 0.24
        Remove channels argument.  Use Conda channels as configured in Conda
        environment.

        Note that channels can still be explicitly set through :data:`*args`.

    Parameters
    ----------
    plugin_name : str or list
        Plugin package(s) to install.

        Version specifiers are also supported, e.g., ``package >=1.0.5``.
    *args
        Extra arguments to pass to Conda ``install`` command.

    Returns
    -------
    dict
        Conda installation log object (from JSON Conda install output).

def install(plugin_name, *args, **kwargs):
    '''
    Install plugin packages based on specified Conda channels.

    .. versionchanged:: 0.19.1
        Do not save rollback info on dry-run.

    .. versionchanged:: 0.24
        Remove channels argument.  Use Conda channels as configured in Conda
        environment.

        Note that channels can still be explicitly set through :data:`*args`.

    Parameters
    ----------
    plugin_name : str or list
        Plugin package(s) to install.

        Version specifiers are also supported, e.g., ``package >=1.0.5``.
    *args
        Extra arguments to pass to Conda ``install`` command.

    Returns
    -------
    dict
        Conda installation log object (from JSON Conda install output).
    '''
    if isinstance(plugin_name, types.StringTypes):
        plugin_name = [plugin_name]

    # Perform installation
    conda_args = (['install', '-y', '--json'] + list(args) + plugin_name)
    install_log_js = ch.conda_exec(*conda_args, verbose=False)
    install_log = json.loads(install_log_js.split('\x00')[-1])
    if 'actions' in install_log and not install_log.get('dry_run'):
        # Install command modified Conda environment.
        _save_action({'conda_args': conda_args, 'install_log': install_log})
        logger.debug('Installed plugin(s): ```%s```', install_log['actions'])
    return install_log