juandesant, (edited )
@juandesant@astrodon.social avatar

A one-liner for exporting your Conda environments for re-creation on another machine… but you might want to have a look at whether you actually need to recreate those environments.

for envs in $(conda env list | egrep -v "^#" | awk '{print $1}'); do echo "Exporting environment: $envs"; conda activate $envs; conda env export --no-builds | egrep -v "^prefix" > "$envs.yaml"; conda deactivate $envs; done; ls -l *.yaml  

/ht @boitarsor for improvement

#bash #zsh #shell #conda #anaconda

boitarsor,
@boitarsor@astrodon.social avatar

@juandesant
Just before the 'done' statement, issuing a 'conda deactivate' will avoid to stack multiple environments.

juandesant,
@juandesant@astrodon.social avatar

@boitarsor you are absolutely right, will amend.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • random
  • GTA5RPClips
  • DreamBathrooms
  • InstantRegret
  • magazineikmin
  • thenastyranch
  • ngwrru68w68
  • Youngstown
  • everett
  • slotface
  • rosin
  • ethstaker
  • Durango
  • kavyap
  • cubers
  • provamag3
  • modclub
  • mdbf
  • khanakhh
  • vwfavf
  • osvaldo12
  • cisconetworking
  • tester
  • Leos
  • tacticalgear
  • anitta
  • normalnudes
  • megavids
  • JUstTest
  • All magazines