7

Working on a cluster with very limited space on my home directory, so I want to set the default from the home directory for ~/.conda/pkgs folder to be another directory and I can't seem to figure out how to do this.

I have tried using the .condarc file with pkg_dirs:

channels:
  - conda-forge
  - bioconda
  - defaults

pkg_dirs: my/new/folder

Ideally this would make the creation and installation of the .conda folder in the new path not my home directory
Al Bro
  • 383
  • 5
  • 15

1 Answers1

10

Gained clarity from this post: and will post answer here for anyone trying to Google

anaconda .conda folder move from /home/usrxy to some other location

The solution is two-fold:

  1. make your .conda folder in home no longer writeable

  2. Add the pkg_dirs correctly to the .condarc file by either conda config --add pkgs_dirs /PATH/TO/FOLDER

or editing your .condarc directly and using the correct syntax

pkgs_dirs:
  - /PATH/TO/FOLDER

See Conda Documentation on setting pkgs_dirs.

merv
  • 67,214
  • 13
  • 180
  • 245
Al Bro
  • 383
  • 5
  • 15
  • This really helped my out as my default .conda/pkgs path contains cyrillic username characters which can't be changed on windows – bashis Nov 07 '19 at 00:38
  • And FYI, the `.condarc` file is in `~/.condarc` for you normal user. In case it is not there, create it. – Shailen Nov 13 '20 at 02:46
  • 2
    Another option: `export CONDA_PKGS_DIRS=/your/path` – Shailen Nov 13 '20 at 02:57