Mamba: Difference between revisions
From Stat DS Computing Wiki
No edit summary |
|||
| (12 intermediate revisions by one other user not shown) | |||
| Line 1: | Line 1: | ||
[[Category:Containers and Virtual Environments]] | |||
Mamba is the free alternative to Conda. It functions similarly and is preinstalled on all Statistics & Data Science servers. All of your created environments are accessible on every server, regardless of the server you created it on. | |||
Installed at... | Installed at... | ||
| Line 8: | Line 10: | ||
== Creating an Environment == | == Creating an Environment == | ||
Create a new Python environment by logging into a server and running the "create" command. | |||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
mamba create -n testenv1 python=3.11 | mamba create -n testenv1 python=3.11 | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Activate the environment. | |||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
mamba activate testenv1 | mamba activate testenv1 | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Install packages to the environment. | |||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
mamba install pandas | mamba install pandas | ||
</syntaxhighlight> | </syntaxhighlight> | ||
== Package | Run a script using the environment. | ||
<syntaxhighlight lang="bash"> | |||
mamba run -n testenv1 python analyze.py | |||
</syntaxhighlight> | |||
List all environments. | |||
<syntaxhighlight lang="bash"> | |||
mamba env list | |||
</syntaxhighlight> | |||
== Package Management == | |||
Useful package management commands. | |||
{| class="wikitable" | {| class="wikitable" | ||
| Line 57: | Line 69: | ||
|} | |} | ||
== | == Maintenance and Configuration == | ||
Commands to view mamba configuration and clean system resources. | |||
{| class="wikitable" | |||
|+ | |||
mamba | !Command | ||
!Purpose | |||
!Eample | |||
|- | |||
|mamba clean --all | |||
|Removes unused packages, caches, and tarballs to free up disk space. Use this frequently! | |||
| | |||
|- | |||
|mamba config list | |||
|Shows the entire Mamba configuration. | |||
| | |||
|- | |||
|mamba config sources | |||
|Shows the location of all configuration files (.condarc). | |||
| | |||
|- | |||
|mamba remove | |||
|Delete an environment | |||
|mamba remove -n envname --al | |||
|} | |||
Latest revision as of 03:21, 29 June 2026
Mamba is the free alternative to Conda. It functions similarly and is preinstalled on all Statistics & Data Science servers. All of your created environments are accessible on every server, regardless of the server you created it on.
Installed at...
/opt/miniforge3/bin/mamba
Creating an Environment
Create a new Python environment by logging into a server and running the "create" command.
mamba create -n testenv1 python=3.11Activate the environment.
mamba activate testenv1Install packages to the environment.
mamba install pandasRun a script using the environment.
mamba run -n testenv1 python analyze.pyList all environments.
mamba env listPackage Management
Useful package management commands.
| Command | Purpose | Example |
|---|---|---|
| mamba install | Installs one or more packages into the current active environment. | mamba install numpy pandas |
| mamba update | Updates a specific package in the current environment. | mamba update numpy |
| mamba update --all | Updates all packages in the current environment. | mamba update --all |
| mamba remove | Removes a package from the current environment. | mamba remove numpy pandas |
| mamba list | Lists all installed packages in the current active environment. | mamba list |
| mamba search | Searches for available packages on Mamba's configured channels. | mamba search tensorflow |
Maintenance and Configuration
Commands to view mamba configuration and clean system resources.
| Command | Purpose | Eample |
|---|---|---|
| mamba clean --all | Removes unused packages, caches, and tarballs to free up disk space. Use this frequently! | |
| mamba config list | Shows the entire Mamba configuration. | |
| mamba config sources | Shows the location of all configuration files (.condarc). | |
| mamba remove | Delete an environment | mamba remove -n envname --al |