I don't have enough space in my default conda directory so I want conda packages to be downloaded at a different location. I have a conda environment created and activated at
/different_drive/condaenv
Based on what I found online, I tried editing the .condarc file to have
pkgs_dirs
- /different_drive/pkgs
and edited the permission of the default directory
/home/user/conda/pkgs/
to read-only. However, I just get permission denied errors as conda still tries to download the files to the default directory. Any suggestions on what I can do to change the download location of the packages?
Conda installs packages into the anaconda/pkgs directory. If conda cannot find the file, try using an absolute path name instead of a relative path name. Installing packages directly from the file does not resolve dependencies.
When you specify an environment directory this is where conda will create the actual environment subdirectories. So what ever you specify as the base envs_dirs it will make a directory in that for each environment you create.
Installing with conda. To install conda packages, in the terminal or an Anaconda Prompt, run: conda install [packagename] During the install process, files are extracted into the specified environment, defaulting to the current environment if none is specified. Installing the files of a conda package into an environment can be thought ...
Linux: /home/ /anaconda3. Where Are Conda Packages Installed? Installing packages through Conda requires you to install them into the anaconda/pkgs directory at once.The best way to help Conda find a file is to use an absolute path title rather than the relative path.Packages cannot be installed directly from the file due to dependencies.
If a package is not available from conda or Anaconda.org, you may be able to find and install the package via conda-forge or with another package manager like pip. Pip packages do not have all the features of conda packages and we recommend first trying to install any package with conda.
A conda package is a compressed tarball file (.tar.bz2) or .conda file that contains: system-level libraries. Python or other modules.
The steps provided at the official conda documentation link, answers the question.
After creating the environment, activate it, then install your packages. The packages shall be installed within this environment and not the default location.
Update
Reproducing the commands below for quick reference:
Following command will create a new environment in a subdirectory of the current working directory called demo
conda create --prefix ./demo python=3.6 scipy=0.15.0
Now, activate the environment as follows:
conda activate ./demo
The environment prompt will have absolute path to the environment, to shorten it, use the trick mentioned at the link above.
In case other people encounter the same problem, as suggested in one of the comments here:
conda config --add pkgs_dirs /new_path_pkgs/
Verify that the pkgs_dirs path is changed:
conda config --show
The packages will be now saved in the new path.
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