Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

I have a RHEL server with Anaconda3 installed. Each user in the system gets 2 GiG space in the /home/ folder and another large folder in a mounted drive. When the user is trying to create a conda environment using conda create -n my_env it fills all the .tar files in .conda folder and installation breaks. Is there a way I specify a custom location for the .conda folder.

Best Jagan

like image 213
Jaganadh Gopinadhan Avatar asked Aug 21 '18 23:08

Jaganadh Gopinadhan


2 Answers

you can use --prefix option documentation

Option 1: If you want to create your virtual environment in current directory then use

conda create --prefix=envName python=X.X

Option 2: if you want to mention the directory then give full path

conda create --prefix=/YourPath/yourEnvName python=x.x

Option 3: If you dont want to explicitly mention the path everytime and want all your environments to be stored somewhere else by default, you can set that up in your .condarc file documentation

You can do this in command line using:

conda config --add envs_dirs <path to directory>

envs_dirs in your .condarc file will add an additional location to the package cache search path.

like image 105
Ajay Bisht Avatar answered Nov 10 '22 00:11

Ajay Bisht


Came across this while having a similar problem with lack of space in my home directory...

Building on Ajay Bisht's solution, to change the package cache search path, you can set

conda config --add pkgs_dirs <path to directory>/pkgs

as well as

conda config --add envs_dirs <path to directory>/envs

See here https://docs.conda.io/projects/conda/en/latest/user-guide/configuration/use-condarc.html#specify-package-directories-pkgs-dirs

like image 21
john Avatar answered Nov 10 '22 00:11

john