2

I know through pip I can download Python packages using the below command. But "pip install" is breaking my internal package dependencies.

When I do:

pip download <package-name> -d <download-path> 

This is supposed to download packages along with their dependencies.

I tried and failed to find this feature for Conda.

Please let me know if there's a way to download python packages along with their dependencies through conda and install the latter offline in the virtual environment.

I need this method because our client restricted access to Pypi and the Anaconda repository.

Hayden Eastwood
  • 878
  • 1
  • 9
  • 20

1 Answers1

2

Sounds like you are looking for the --download-only flag. From conda install --help:

--download-only       Solve an environment and ensure package caches are
                      populated, but exit prior to unlinking and linking
                      packages into the prefix.

The "solve and environment" part indicates that it will include all dependencies.

The --offline flag could also be helpful for the latter time when you try installing. This will force Conda to attempt to use only the cached packages to satisfy package specifications.

merv
  • 53,208
  • 11
  • 148
  • 196
  • I did below steps. Lets say for python package spacy. (1)set CONDA_PKGS_DIRS= (2)conda install -c conda-forge spacy --download-only --> it will download to folder set in CONDA_PKGS_DIRS. (3) conda install --offline spacy. This will install from the package present in CONDA_PKGS_DIRS. We can change also CONDA_PKGS_DIRS if we are moving the location of installation. – Mukesh Kumar Sah Jul 15 '20 at 10:30