Check out conda-tree.
Usage (based on the conda-tree webpage):
# version
$ conda-tree --version
conda-tree 0.0.4
# packages that no other package depends on
$ conda-tree leaves
['samtools','bcftools',...]
# dependencies of a specific package
$ conda-tree depends samtools
['curl', 'xz', 'libgcc', 'zlib']
# which packages depend on a specific package
$ conda-tree whoneeds xz
['samtools', 'bcftools', 'htslib', 'python']
# dependency cycles
$ conda-tree cycles
pip -> python -> pip
pip -> wheel -> python -> pip
# query a different conda prefix/env
$ conda-tree -p /conda/envs/trinity leaves
['trinity']
# query by name
$ conda-tree -n trinity leaves
['trinity']
For dependencies installed with pip
, check out pipdeptree
. It will return a dependency tree of the packages (installed with pip
. See the documentation)
try:
pipdeptree
Or if you are looking for the leaves only
pipdeptree --freeze --warn silence | grep -P '^[\w0-9\-=.]+'
See also this answer.