def install_dependencies(plugins_directory, ostream=sys.stdout):
    '''
    Run ``on_plugin_install`` script for each plugin directory found in
    specified plugins directory.

    Parameters
    ----------
    plugins_directory : str
        File system path to directory containing zero or more plugin
        subdirectories.
    ostream : file-like
        Output stream for status messages (default: ``sys.stdout``).
    '''
    plugin_directories = plugins_directory.realpath().dirs()

    print >> ostream, 50 * '*'
    print >> ostream, 'Processing plugins:'
    print >> ostream, '\n'.join(['  - {}'.format(p)
                                    for p in plugin_directories])
    print >> ostream, '\n' + 50 * '-' + '\n'

    for plugin_dir_i in plugin_directories:
        try:
            on_plugin_install(plugin_dir_i, ostream=ostream)
        except RuntimeError, exception:
            print exception
        print >> ostream, '\n' + 50 * '-' + '\n'
Run ``on_plugin_install`` script for each plugin directory found in
    specified plugins directory.

    Parameters
    ----------
    plugins_directory : str
        File system path to directory containing zero or more plugin
        subdirectories.
    ostream : file-like
        Output stream for status messages (default: ``sys.stdout``).