How to change location of conda’s environments.txt file

I am attempting to move conda data to .local/share as to not clutter my home. My conda configuration file, located at home/user/.config/conda/condarc is the following:

  - /home/user/.local/share/conda/local_envs/

  - /home/user/.local/share/conda/env_pkgs/

auto_activate_base: false

with this in place I expect created environments to store data in /home/user/.local/share/conda/local_envs/, which happens to be the case. The problem that I am trying to fix is that to keep track of these envs conda creates a directory
/home/.conda containing the environments.txt file
, which just lists all existing envs. I don’t want this directory to be created, but am failing to change this behaviour.

The output of conda config --show lists the following envs_dirs path, which might be related to the issue:

  - /home/user/.local/share/conda/local_envs
  - /home/user/.local/share/conda/envs
  - /home/user/.conda/envs

This is weird considering that only one of these is listed in my condarc, such that atttempt to remove the unwanted paths (conda config --remove envs_dirs /home/gala/.conda/envs) give the following error

CondaKeyError: 'envs_dirs': key 'envs_dirs' is not in the config file

Read more here: Source link