def pipinstall(packagename, pips=None, trypips=[], scripts=None):
    """
    Install packages from pip.

    The primary advantage of using this function is that homely can
    automatically remove the package for you when you no longer want it.

    package:
      The name of the pip package to install

    pips:
      A list of `pip` executables to install the package with.

      `['pip2.7', 'pip3.4']` would install the package using both the `pip2.7`
      and `pip3.4` executables. The default is to use `['pip']` as long as you
      aren't using `trypips`.

    trypips:
      This is a supplementary list of `pip` executables that homely will use to
      install the package, but no exception will be raised if the `pip`
      executables aren't available.

    Note that the `pip install ...` commands are run with the `--user` option
    so that the packages are installed into your home directory.
    """
    # `scripts` is an alternate location for bin scripts. Useful for bad
    # platforms that put pip2/pip3 scripts in the same bin dir such that they
    # clobber each other.
    # FIXME: `scripts` still has the following issues
    # - useless if you're specifying multiple pips at once
    # - won't do the uninstall/reinstall dance to reinstall something that was
    #   installed with a different `scripts` path
    if scripts is None:
        scripts = {}
    if pips is None:
        pips = [] if len(trypips) else ['pip']
    engine = getengine()
    for pip in pips:
        helper = PIPInstall(packagename,
                            pip,
                            mustinstall=True,
                            scripts=scripts.get(pip))
        engine.run(helper)
    for pip in trypips:
        helper = PIPInstall(packagename,
                            pip,
                            mustinstall=False,
                            scripts=scripts.get(pip))
        engine.run(helper)
Install packages from pip.

    The primary advantage of using this function is that homely can
    automatically remove the package for you when you no longer want it.

    package:
      The name of the pip package to install

    pips:
      A list of `pip` executables to install the package with.

      `['pip2.7', 'pip3.4']` would install the package using both the `pip2.7`
      and `pip3.4` executables. The default is to use `['pip']` as long as you
      aren't using `trypips`.

    trypips:
      This is a supplementary list of `pip` executables that homely will use to
      install the package, but no exception will be raised if the `pip`
      executables aren't available.

    Note that the `pip install ...` commands are run with the `--user` option
    so that the packages are installed into your home directory.