@plugin.command()<EOL>@click.argument('<STR_LIT>', required=True)<EOL>@click.pass_context<EOL>def install(ctx, plugin):
ensure_inside_venv(ctx)<EOL>plugin_name = get_plugin_name(plugin)<EOL>try:<EOL><INDENT>info = get_plugin_info(plugin_name)<EOL><DEDENT>except NameError:<EOL><INDENT>echo_error("<STR_LIT>".format(plugin))<EOL>sys.exit(<NUM_LIT:1>)<EOL><DEDENT>except ValueError as e:<EOL><INDENT>echo_error("<STR_LIT>"<EOL>"<STR_LIT>".format(e))<EOL>sys.exit(<NUM_LIT:1>)<EOL><DEDENT>try:<EOL><INDENT>installed_version = pkg_resources.get_distribution(plugin_name).version<EOL><DEDENT>except pkg_resources.DistributionNotFound:<EOL><INDENT>installed_version = None<EOL><DEDENT>if installed_version is not None and info['<STR_LIT:version>'] == installed_version:<EOL><INDENT>click.echo("<STR_LIT>".format(<EOL>plugin, info['<STR_LIT:version>']<EOL>))<EOL>return<EOL><DEDENT>pinned_plugin = '<STR_LIT>'.format(plugin_name, info['<STR_LIT:version>'])<EOL>try:<EOL><INDENT>run_command([sys.executable, '<STR_LIT>', '<STR_LIT>', '<STR_LIT>', pinned_plugin])<EOL><DEDENT>except subprocess.CalledProcessError as e:<EOL><INDENT>echo_error("<STR_LIT>"<EOL>"<STR_LIT>".format(plugin, e))<EOL>sys.exit(<NUM_LIT:1>)<EOL><DEDENT>echo_success("<STR_LIT>".format(<EOL>plugin, info['<STR_LIT:version>']<EOL>))<EOL>
Install the given plugin.