0

I created an environment via conda create --prefix /export/user/my_env python=3.9.

conda info outputs:

     active environment : /export/user/my_env
    active env location : /export/user/my_env
                      (...)
          conda version : 22.11.1
    conda-build version : not installed
         python version : 3.9.12.final.0
       base environment : /home/user/miniconda3  (writable)
      conda av data dir : /home/user/miniconda3/etc/conda
          package cache : /home/user/miniconda3/pkgs
                          /home/user/.conda/pkgs
       envs directories : /home/user/miniconda3/envs
                          /home/user/.conda/envs
                      (...)

However, when I try installing something, e.g., conda install pytorch, it fails because there is no space left in my home directory.

InvalidArchiveError('Error with archive /home/user/miniconda3/pkgs/pytorch-1.13.1-py3.9_cuda11.7_cudnn8.5.0_0.tar.bz2.  You probably need to delete and re-download or re-create this file.  Message from libarchive was:\n\nfailed with error: [Errno 28] No space left on device')

The big question is why does it try to install to the base environment (/home/user/miniconda3/) instead of /export/user/my_env (where space is)?

ScientiaEtVeritas
  • 5,158
  • 4
  • 41
  • 59
  • Answer in duplicate is same in principle - the package cache should also be offloaded to additional storage location. – merv Feb 02 '23 at 23:25

1 Answers1

1

When you install packages via conda, it caches files that are downloaded in the "package cache" directory. You can see from your output above that the package cache directories are both within /home/user.

You can change the package cache directory by running:

conda config --add pkgs_dirs /export/user/my_new_cache
Will Holtz
  • 677
  • 5
  • 17