|
1 | 1 | # Conda Cheatsheet
|
2 | 2 |
|
3 |
| -## Managing Environments |
| 3 | +## Conda |
4 | 4 |
|
5 | 5 | |Command|Desc|
|
6 | 6 | |-------|----|
|
| 7 | +||| |
| 8 | +|Managing Environments|| |
| 9 | +||| |
7 | 10 | |`conda info`|get version info|
|
8 |
| -|`conda create --name ENVNAME python=3.10`|create new environment with package list| |
9 |
| -|`conda env create --name ENVNAME --file environment.yml`|create new environment from file| |
10 |
| -|`conda env remove --name ENVNAME --all`|delete an entire environment| |
11 |
| -|`conda activate ENVNAME / conda deactivate`|activate/deactivate environment| |
| 11 | +|`conda create --name <ENV> python=3.10`|create new environment with package list| |
| 12 | +|`conda env create --name <ENV> --file env.yml`|create new environment from file| |
| 13 | +|`conda env remove --name <ENV> --all`|delete an entire environment| |
| 14 | +|`conda activate <ENV>`/`conda deactivate`|activate/deactivate environment| |
| 15 | +|`conda list --explicit > spec.txt`|produce an environment spec file| |
| 16 | +|`conda env export --from-history > env.yml`|export environment to file| |
| 17 | +||| |
| 18 | +|Managing Packages|| |
| 19 | +||| |
12 | 20 | |`conda install PKGNAME==3.1.4`|install specific package|
|
13 | 21 | |`conda install --file requirements.txt`|install from requirements file|
|
14 |
| -|`conda list --explicit > spec.txt`|produce an environment spec file| |
15 |
| -|`conda env export --from-history > environment.yml`|export environment to file| |
| 22 | +|`conda update conda`|update conda| |
| 23 | +|`conda update python`|update python version| |
| 24 | +|`conda update anaconda`|update all packages to latest stable + compatible version of Anaconda| |
| 25 | +|`conda update -n base conda`|update base conda environment| |
| 26 | +|`conda env update -n myenv -f env.yml --prune`|update and uninstall dependencies from environment using file| |
16 | 27 |
|
17 |
| -## Migrating Environments |
| 28 | +### Migrating Environments |
18 | 29 |
|
19 | 30 | - Using `conda-minify` to export minimal environment
|
20 | 31 | ```bash
|
21 | 32 | conda install conda-minify -c jamespreed
|
22 |
| - conda-minify --name EnvName [--relax] [--how [full|minor]] [-f ./test_env.yml] |
| 33 | + conda-minify --name <ENV> [--relax] [--how [full|minor]] [-f ./test_env.yml] |
23 | 34 | ```
|
24 | 35 |
|
25 |
| -## Update |
| 36 | +## Mamba |
26 | 37 |
|
27 | 38 | |Command|Desc|
|
28 | 39 | |-------|----|
|
29 |
| -|`conda update conda`:|Update conda| |
30 |
| -|`conda update python`:|Update python version| |
31 |
| -|`conda update anaconda`:|Update all packages to latest stable + compatible version of Anaconda| |
32 |
| -|`conda update -n base conda`:|Update base conda environment| |
33 |
| -|`conda env update -n myenv -f env.yml --prune`:|Update and uninstall dependencies from environment using file| |
| 40 | +||| |
| 41 | +|Managing Environments|| |
| 42 | +||| |
| 43 | +|`mamba info`|get version info| |
| 44 | +|`conda env list`|list environments| |
| 45 | +|`conda env export --no-builds`|show environment| |
| 46 | +|`mamba create -n <ENV> <PKG>`|create an environment| |
| 47 | +|`mamba env create --file env.yml`|import an environment| |
| 48 | +|`mamba env export -n <ENV> > env.yml`|export an environment| |
| 49 | +|`mamba env remove -n <ENV>`|remove an environment| |
| 50 | +|`conda create --name CLONE_ENV_NAME --clone <ENV>`|clone an existing environment| |
| 51 | +|`conda activate <ENV>`/`conda deactivate`|activate/deactivate environment| |
| 52 | +||| |
| 53 | +|Managing Packages|| |
| 54 | +||| |
| 55 | +|`mamba repoquery search <PKG>`|finding package| |
| 56 | +|`mamba install -n <ENV> <PKG>`|install package| |
| 57 | +|`mamba update -n base mamba`|updating mamba| |
| 58 | +|`mamba update -n <ENV> --all`|update package| |
| 59 | +|`mamba remove -n <ENV> <PKG>`|removing a package| |
| 60 | +|`mamba repoquery search <PKG>`|search for pacakge| |
| 61 | +|`mamba repoquery depends <PKG> [--recursive]`|show pkg direct/transitive dependencies| |
| 62 | +|`mamba repoquery depends -t <PKG>`|show pkg transitive dependencies as tree| |
| 63 | +|`mamba repoquery whoneeds <PKG>`|show pkg dependants i.e. inverse of depends| |
| 64 | +|`mamba repoquery whoneeds -t <PKG>`|show pkg dependants as tree| |
34 | 65 |
|
35 | 66 | ## References
|
36 | 67 |
|
37 | 68 | - [manage environments](https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html)
|
38 | 69 | - [Official Cheatsheet](https://docs.conda.io/projects/conda/en/latest/user-guide/cheatsheet.html)
|
| 70 | +- [mamba quickstart](https://mamba.readthedocs.io/en/latest/user_guide/mamba.html#quickstart) |
0 commit comments