cd /home/nanguo/miniconda3/envs/<環境名稱>.
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
在 ./etc/conda/activate.d/env_vars.sh
中加入設定變量的指令:code
#!/bin/sh export MY_KEY='secret-key-value' export MY_FILE=/path/to/my/file/
最後在 ./etc/conda/deactivate.d/env_vars.sh
中加入:變量
#!/bin/sh unset MY_KEY unset MY_FILE