Last active
February 16, 2021 03:36
-
-
Save mfansler/7e7307101c5e3ceb47e379877187214e to your computer and use it in GitHub Desktop.
Script to archive Conda environments to YAML
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -le | |
# Usage: ./conda-archive.sh foo | |
# Result: creates "foo.full.yaml", "foo.min.yaml", and removes "foo" environment | |
echo "Archiving environment '$1' to YAML" | |
conda env export -vn $1 > $1.full.yaml | |
conda env export -vn $1 --from-history > $1.min.yaml | |
echo "Removing environment '$1'" | |
conda env remove -vn $1 | |
echo "Done." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment