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
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.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With