a simple bash script that helps you to migrate your anaconda environment from one path to another and takes care of all path conversions in your environments
Syntax: ./conda-migrate.sh current_path new_path
This tool is necessary because actually moving a conda installation tends to break everything. Instead, it is necessary to:
-
(optional) fix the prefix of a previous attempt to move anaconda installation
-
install a fresh miniconda into the target directory
-
export all of the environments from the old conda installation
-
reinstall these environments into the new fresh miniconda install directory.
The reinstallation is done in two steps:
-
try to install the exact packages as the original environment (using an explicit specification file)
-
if that fails, install the packages using an environment file (
conda env export > environmentname.yml
) -
if that also fails, save the environment name to to a list of failed environments. You'll have to tweak the environment.yml file yourself and install them using
conda env create -f environment.yml
forked from matthuska/conda-move
Changelog:
- November 2020: Added options to fix prefix in botched conda installations, renamed variables, added additional checks and warnings throughout the script