from pathlib import Path
import shutil


def pwhich(command: str) -> Path:
    """Path to given command.

    shutil.which only returns a string.
    :returns: Path to command
    :rtype: pathlib.Path
    """
    path_str = shutil.which(command)
    assert path_str, f"{command} not found"
    return Path(path_str)