python – Moving conda environments cross-platform offline

Two ideas for your cross-platform issue:

A)
Use WSL on your windows machine, download and install miniconda there, solve for the environment that you want, then use conda pack to pack and ship it to your offline machine

B)
Create a dummy env on windows, set the subdir to linux and then use --download-only to populate the pkgs directory with the required packages, then move those files to your linux machine and use conda install --offline:

conda create -n linux_64
conda activate linux_64
conda config --env --set subdir linux-64
conda install --download-only python numpy pandas matplotlib #whatever packages you want

You will get Invalid archive errors, which stem from the fact that linux packages often contain simlinks which cannot be unpacked on windows. In your pkgs directory, you should have a bunch of .conda files now, which you should copy to your offline machines pkgs dir and then run

conda install --offline python numpy pandas matplotlib #whatever packages you want

Read more here: Source link