Conda/Miniconda is a great virtual enviroment server, saving enviroments to conda is really simple:
1 – Locate the directory for the conda environment in your terminal window by running in the terminal echo $CONDA_PREFIX.
2 – Enter that directory and create these subdirectories and files (MAC/Linux):
cd $CONDA_PREFIX
mkdir -p ./etc/conda/activate.d
mkdir -p ./etc/conda/deactivate.d
touch ./etc/conda/activate.d/env_vars.sh
touch ./etc/conda/deactivate.d/env_vars.sh
2.1 – Enter that directory and create these subdirectories and files (Windows):
cd %CONDA_PREFIX%
mkdir .\etc\conda\activate.d
mkdir .\etc\conda\deactivate.d
type NUL > .\etc\conda\activate.d\env_vars.bat
type NUL > .\etc\conda\deactivate.d\env_vars.bat
3 – Edit ./etc/conda/activate.d/env_vars.sh as follows:
#!/bin/sh
export MY_KEY='secret-key-value'
export MY_FILE=/path/to/my/file/
3.1 – Edit .\etc\conda\activate.d\env_vars.bat as follows:
set MY_KEY='secret-key-value'
set MY_FILE=C:\path\to\my\file
4 – Edit ./etc/conda/deactivate.d/env_vars.sh as follows:
#!/bin/sh
unset MY_KEY
unset MY_FILE
4.1 – Edit .\etc\conda\deactivate.d\env_vars.bat as follows:
set MY_KEY=
set MY_FILE=