def chunks(l, n):
    return [l[i:i + n] for i in range(0, len(l), n)]
cmd = "pip freeze | cut -f 1 -d'=' |  xargs -L1 pip show"
packages = os.popen(cmd).read()
How can I see all packages that depend on a certain package with PIP?