when using conda python it appears a good idea to use for example conda init bash to decorate ~/.bashrc with an automatic conda setup. It's actually a terrible idea.


Recommendation

  • Don't use conda init!
  • Don't add conda installations to your PATH!
  • It can break lot of things! Errors reporting "Unable to load a failsafe session" or "D-BUS setup problem" are almost always due to conda setup in your login script!
  • If you did: remove the conda initialize section and corresponding PATH's from any login script
  • initialize the conda environment when you need it!
  • If you absolutely want to keep the conda setup, run once conda config --set auto_activate_base false

To setup conda in a flexible way

module load maxwell conda  # or conda/<version> or anaconda-python/<version> to use a specific version
. conda-init

The side effects of conda init

most conda installations contain conflicting DBUS versions. As soon as they get into your PATH - and by default they will after conda init - lots of things won't work properly anymore.

Most notably

  1.  it breaks XFCE, KDE, GNOME or any other window manager.
  2. Trying to launch a graphical session with FastX or via https://max-display.desy.de will fail.
  3. Even worse: it will leave dead fastx-session-links behind which prevent using FastX even after removing the conda initialize section
  4. it messes up MPI environments

It also complicates the creation of new conda environments. Lets assume conda init was used for your own miniconda installation. Now you want to use a different or newer conda setup, for example using the recommended

module load maxwell conda  # or conda/<version> to use a specific version
. conda-init

conda-init won't have any effect, since conda had already been setup in ~/.bashrc. conda will continue looking into your miniconda-installation, but python will be the one selected by the module. Expect a real mess.

Conda init for your own conda installation

Create for example a file in your PATH, $HOME/bin is a good place, name it e.g. my-favorite-conda-setup, and simply place the corresponding conda init section into that file. Run in your terminal

. my-favorite-conda-setup