e('-', ' ')
            kwargs.update({
                'path': path,
                'version': version,
            })
        yield PipPackage(**kwargs)


def add_pip_installed(prefix, installed_pkgs, json=None, output=True):
    # Defer to json for backwards compatibility
    if isinstance(json, bool):
        output = not json

    # TODO Refactor so installed is a real list of objects/dicts
    #      instead of strings allowing for direct comparison
    # split :: to get rid of channel info
    conda_names = {d.quad[0] for d in installed_pkgs}
    for pip_pkg in installed(prefix, output=output):
        if pip_pkg['name'] in conda_names and 'path' not in pip_pkg:
            continue
        installed_pkgs.add(str(pip_pkg))
