Skip to content

Instantly share code, notes, and snippets.

@joel-kelly
joel-kelly / export_conda_env.py
Created July 8, 2022 18:07
Export all conda environments as yml files to a specified directory
import subprocess as sub
import re
import os
#modified from https://github.com/conda/conda/issues/5165
# create list of current environments
sub.check_call(" ".join(['conda','env','list','>','envs.txt']),shell=True)
# load and parse environment names
envs = {}