Install miniconda
mamba
is a faster, drop-in replacement for conda
. You can swap almost all commands between conda
& mamba
...
The only difference is that you should still use
conda
foractivation
anddeactivation
.
Code below will still use conda
for compatibility, but use of mamba
is strongly encouraged, especially for resolving/installing environments with complicated dependencies.
Install mamba to the base environment.
Check if conda is in PATH
and set as default python
conda install mamba -n base -c conda-forge
Note: After installing mamba
, leave base
environment untouched and work only in other envs
conda create --name <env_name> python=3.7 <package_1> <other-channel::package_2> ...
conda create --name <myclone> --clone <exisiting_env>
conda env create -f /path/to/environment.yml
Activate an environment to use it (or to install packages to it):
conda activate <env_name
Install conda environment to jupyter:
python -m ipykernel install --user --name=<env_name>
Export exact specifications:
conda env export --name ENVNAME > environment.yml
Export an environment for cross-platform:
conda env export --name ENVNAME --from-history > environment.yml
conda remove --name <env_name> --all
IMPORTANT: setting to revision #0 basically uninstalls all environments! Use --revision 1
at minimum
conda list --revisions # lists all changes in order
conda install --revision <rev_num> # resets state to <rev_num>