Search code examples
environment-variablescondamamba

How to make conda or mamba verbose using environment variable?


I am looking for an environment variable I can set to make mamba verbose while it is resolving the dependency to see if it is stuck at a certain stage.


Solution

  • This can be done either through Conda configuration (i.e., .condarc) or an environment variable. The environment variable has the highest priority, so I recommend setting default behavior via the configuration such that the environment variable is still available for overriding.

    There is an (older) article detailing the Conda configuration system: "The Conda Configuration Engine for Power Users".

    Conda Configuration

    The configuration variable is verbosity. Here is the description:

    $ conda config --describe verbosity
    # # verbosity (int)
    # #   aliases: verbose
    # #   Sets output log level. 0 is warn. 1 is info. 2 is debug. 3 is trace.
    # # 
    # verbosity: 0
    

    which shows 0 is the default. It can be set with

    conda config --set verbosity 2  # debug by default
    

    Environment Variable

    All Conda configuration variables can be set via CONDA_* environment variables. To override the verbosity configuration, one can use:

    ## temporary setting
    CONDA_VERBOSITY=2 conda info
    
    ## permanent setting, e.g., in a .bashrc or .bash_profile
    export CONDA_VERBOSITY=2