• Stars
    star
    159
  • Rank 235,864 (Top 5 %)
  • Language
    Python
  • License
    MIT License
  • Created over 7 years ago
  • Updated almost 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

conda dependency tree helper

conda-tree

conda dependency tree helper

Install

conda install -c conda-forge conda-tree

If you're using python 3.9 you might have to run:

conda install -c conda-forge conda-tree 'networkx>=2.5'

to make sure the right networkx version is installed.

Conda sub-command

When conda-tree is installed on the base environment, you can use the "tree" sub-command from any env:

# normal usage
(base) $ conda tree leaves
package-1
package-2

# activate another env
(base) $ conda activate env2

# no need to install conda-tree on env2
(env2) $ conda tree leaves
package-x
package-y

Features

Query the dependency tree

# packages that no other package depends on
$ conda-tree leaves
samtools
bcftools
etc

# 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

Dependencies in tree form

# dependencies in a tree form
# (redundancies are hidden by default)
$ conda-tree depends -t sqlite
sqlite==3.29.0
  ├─ ncurses 6.1 [required: >=6.1,<6.2.0a0]
  │  └─ libcxx 8.0.1 [required: >=4.0.1]
  │     └─ libcxxabi 8.0.1 [required: 8.0.1, 0]
  └─ readline 8.0 [required: >=8.0,<9.0a0]
     └─ ncurses 6.1 [required: >=6.1,<6.2.0a0]
        └─ dependencies of ncurses displayed above

# full dependency tree
$ conda-tree deptree --full
neovim==0.3.1
  ├─ pynvim 0.3.2 [required: any]
  │  ├─ greenlet 0.4.15 [required: any]
  │  │  └─ python 3.7.3 [required: >=3.7,<3.8.0a0]
  │  │     ├─ bzip2 1.0.8 [required: >=1.0.6,<2.0a0]
  │  │     ├─ libcxx 8.0.1 [required: >=4.0.1]
  │  │     │  └─ libcxxabi 8.0.1 [required: 8.0.1, 0]
  │  │     ├─ libffi 3.2.1 [required: >=3.2.1,<3.3.0a0]
...
conda-tree==0.0.4
  ├─ conda 4.7.11 [required: any]
  │  ├─ conda-package-handling 1.4.1 [required: >=1.3.0]
  │  │  ├─ libarchive 3.3.3 [required: >=3.3.3]
  │  │  │  ├─ bzip2 1.0.8 [required: >=1.0.6,<2.0a0]
...

Query another env

# query by path
$ conda-tree -p /conda/envs/trinity leaves
trinity

# query by name
$ conda-tree -n trinity leaves
trinity

Query package files

# find which package owns a file
$ conda-tree -n graphviz who-owns bin/dot
graphviz bin/dot
graphviz bin/dot2gxl
graphviz bin/dot_builtins

# find dangling files that aren't owned by any package
$ conda-tree -n base unowned-files
/conda/LICENSE.txt

$ conda-tree -n graphviz unowned-files
/conda/envs/graphviz/var/cache/fontconfig/b67b32625a2bb51b023d3814a918f351-le64.cache-7
/conda/envs/graphviz/var/cache/fontconfig/f93dd067-84cf-499d-a5a8-645ff5f927dc-le64.cache-7
/conda/envs/graphviz/var/cache/fontconfig/923e285e415b1073c8df160bee08820f-le64.cache-7
/conda/envs/graphviz/fonts/.uuid

Generate a minimal set of packages to re-create the env

# can be used to re-create a env with conda create -n <new-env> --file <dep-file>
$ conda-tree -n graphviz leaves --export
conda-forge::graphviz=2.48.0=h85b4f2f_0

Generate a graph of the dependency tree

# export a graphviz dot notation file of the dependencies tree
$ conda-tree deptree --dot > file.dot
$ conda-tree depends <package> --dot > file.dot
$ conda-tree whoneeds <package> --dot > file.dot

# then render to pdf with graphviz's dot tool
$ dot -Tpdf file.dot -o tree.pdf

More Repositories

1

setup-miniconda

Set up your GitHub Actions workflow with conda via miniconda
TypeScript
400
star
2

conda-zsh-completion

zsh completion for conda
Shell
357
star
3

condacolab

Install Conda and friends on Google Colab, easily
Jupyter Notebook
331
star
4

conda-store

Data science environments, for collaboration. ✨
Python
140
star
5

conda-press

Press conda packages into wheels
Python
115
star
6

conda-docker

Create minimal docker images from conda environments
Python
60
star
7

conda-env-builder

Build and maintain multiple custom conda environments all in one place.
Scala
36
star
8

conda-dot-org

conda.org website
MDX
28
star
9

conda-project

Tool for encapsulating, running, and reproducing projects with Conda environments
Python
28
star
10

ensureconda

Simple installer for conda (and conda-likes)
Python
15
star
11

conda-store-ui

conda-store-ui is a frontend for conda-store powered by react
TypeScript
13
star
12

jupyterlab-conda-store

The official Jupyterlab extension for conda-store
TypeScript
13
star
13

conda-pypi

Better PyPI interoperability for the conda ecosystem
Python
11
star
14

conda-suggest

Suggest packages to install to obtain command line utilities
Python
9
star
15

condastats

Python
8
star
16

conda-protect

Protect conda environments to avoid mistakenly modifying them
Python
6
star
17

conda-recipe-manager

A project for libraries and automated tools that manage and manipulate conda recipe files.
Python
6
star
18

conda.org

The code for the conda.org website
5
star
19

conda-subchannel

Create subsets of conda channels thanks to CEP-15 metadata
Python
4
star
20

conda.sh

JavaScript
4
star
21

asht

Abstract Shell Tree
Python
3
star
22

conda-auth

Conda plugin for various conda auth handlers
Python
3
star
23

plugins

A collection of conda plugins
3
star
24

conda-tutorial

A conda tutorial
3
star
25

installer

The conda installers and tools to maintain them
2
star
26

conda-sphinx-theme

A Sphinx theme for conda documentations
JavaScript
1
star
27

conda-shell

Shell hook and conda plugins for environment activation and deactivation.
Python
1
star
28

conda-tui

An experimental TUI for conda using Textual
Python
1
star