def uninstall(plugin_package, plugins_directory):
<EOL>plugin_path = plugins_directory.joinpath(plugin_package)<EOL>if not plugin_path.isdir():<EOL><INDENT>raise IOError('<STR_LIT>' %<EOL>(plugin_package, plugins_directory))<EOL><DEDENT>else:<EOL><INDENT>try:<EOL><INDENT>plugin_metadata = yaml.load(plugin_path.joinpath('<STR_LIT>').bytes())<EOL>existing_version = plugin_metadata['<STR_LIT:version>']<EOL><DEDENT>except:<EOL><INDENT>existing_version = None<EOL><DEDENT><DEDENT>if existing_version is not None:<EOL><INDENT>print('<STR_LIT>'.format(plugin_package, existing_version))<EOL><DEDENT>else:<EOL><INDENT>print('<STR_LIT>'.format(plugin_package))<EOL><DEDENT>plugin_path.rmtree()<EOL>print('<STR_LIT>')<EOL>
Parameters
----------
plugin_package : str
    Name of plugin package hosted on MicroDrop plugin index.
plugins_directory : str
    Path to MicroDrop user plugins directory.