Skip to content
Advertisement

conda prefix (-p) still create a .conda directory on home

I’m using conda prefix to specify the directory to create my conda environment since my home directory has a small storage quota. But I noticed that conda still creating a .conda directory in my home directory which is quite large.

I’m running the following command.

JavaScript

The .conda dir in my home directory has:

  • environments.txt file with the symbolic link to the env create using the prefix.
  • pkgs directory with many python packages.

Is there a way to avoid creating the .conda dir in my home directory or make it very small?

Advertisement

Answer

The ~/.conda/environments.txt is unavoidable. The location of environments and packages is controlled by the envs_dirs and pkgs_dirs variables respectively. See docs:

JavaScript

Recommendation

Provide a pkgs_dirs directory that isn’t in under your home directory. Also, since Conda uses hardlinks to conserve disk usage, it is recommended you also provide an envs_dirs that is on the same volume. This also gives you the advantage that you should no longer need to specify a --prefix,-p argument to avoid environments being created under the user home, but you can instead use a --name,-n argument and specify your environments by name.

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement