'How to download a full package dependency chain using conda?

I have a requirements file that describes the conda packages I need. These are required dependencies in a script I want to run. The script needs to run on a machine that is not connected to a network or internet. Therefore, I have decided to use download-only as explained here.

This is not working for me. When I choose just one dependency to download, I get an error. This is my command-line statement:

conda install --download-only grpcio=1.35.0

This is the error I get:

CondaExitZero: Package caches prepared. UnlinkLinkTransaction cancelled with --download-only option

Apparently, the download-only is in this cases helps me to cancel the download.... That is not what I want. I want to download the full dependency chain in order to use it in an offline environment.

How do I do that?



Solution 1:[1]

Please file a bug report on the Conda repository, since this appears that it shouldn't be happening. I suspect the issue is that for download-only transactions, Conda still determines that a package might need to be removed in order to eventually install the requested package. That shouldn't be necessary, so I'd call that a bug.

In the meantime, either try creating a new environment and then using the --download-only flag with that environment activated. Alternatively, this answer shows how to download raw packages for a full solve, ignoring any existing package cache.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 merv