Last active
March 27, 2018 21:27
-
-
Save planetceres/246be8e4fa0d731669e5803f444972ad to your computer and use it in GitHub Desktop.
Export all conda env to environment.yml `bash conda_export_all.sh <folder path for backup>`
This file contains hidden or 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 | |
. ~/anaconda3/etc/profile.d/conda.sh | |
NOW=$(date "+%Y-%m-%d") | |
if [ $1 -eq 0 ]; then | |
DIR='~/Desktop/condas/' | |
else | |
DIR=$1 | |
fi | |
mkdir $DIR/envs-$NOW | |
ENVS=$(conda env list | grep '^\w' | cut -d' ' -f1) | |
for env in $ENVS; do | |
conda activate $env | |
conda env export > $DIR/envs-$NOW/$env.yml | |
echo "Exporting $env" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment