Closed HenrikBengtsson closed 2 years ago
Wow, it works;
$ conda activate myenv
INFO: Staging current conda environment (/home/hb/.conda/envs/myenv) to local disk ...
INFO: Extracting /home/hb/.conda/envs/myenv.tar.gz (397363978 bytes; 2022-04-14 14:51:40.967483116 -0700) to /tmp/hb/conda-stage-LZtb/myenv
INFO: Total extract time: 10 seconds
INFO: Unpacking
INFO: Total 'conda-unpack' time: 0 seconds
INFO: Activating staged conda environment: /tmp/hb/conda-stage-LZtb/myenv
After more tweaks, it's now also possible to unstage back to the original conda environment;
$ conda activate myenv
INFO: Staging current conda environment (/home/hb/.conda/envs/myenv) to local disk ...
INFO: Extracting /home/hb/.conda/envs/myenv.tar.gz (397363978 bytes; 2022-04-14 14:51:40.967483116 -0700) to /tmp/hb/conda-stage-Iwpc/myenv
INFO: Total extract time: 14 seconds
INFO: Unpacking
INFO: Total 'conda-unpack' time: 0 seconds
INFO: Make staged environment read-only
INFO: Activating staged conda environment: /tmp/hb/conda-stage-Iwpc/myenv
20220414-W15-4 (d104) 18:35:04 hb-x1:~/repositories/conda-stage
$ conda-stage --unstage
INFO: Unstaging and reverting to original conda environment ...
INFO: Original conda environment: /home/hb/.conda/envs/myenv
INFO: Removing all staged files: /tmp/hb/conda-stage-Iwpc/myenv
INFO: Activating original conda environment: /home/hb/.conda/envs/myenv
INFO: Total unstage time: 1 seconds
Added;
conda-stage --auto-stage=enable
to automatically stage a conda
environment when activated. Add --read-only
to stage a read-only
environment. To undo, call conda-stage --auto-stage=disable
.
We could add
conda-stage --install-auto-stage
, which installs a "hook" script to the original conda environment, e.g.