Conda Packages#

audience:administrators audience:developers audience:all

Most Tango packages are available on conda-forge for Linux, macOS and Windows.

Conda packages can be used in production or for development on your machine.

Tip

The above list is not exhaustive, especially for Python packages. You can always search on anaconda or prefix.dev to check if a package is available.

conda is the original package manager to work with conda packages, but there are alternatives:

  • mamba: a Python-based CLI conceived as a drop-in replacement for conda, offering higher speed.

  • micromamba: a pure C++-based CLI, self-contained in a single-file executable.

  • pixi: a Rust-based package manager and workflow tool built on the foundation of the conda ecosystem. It is also the easiest way to install global tools.

conda/mamba/micromamba#

In the following, we’ll show commands using conda. You should be able to replace conda with mamba or micromamba based on your preference.

micromamba supports a subset of all mamba or conda commands, but the most frequent ones are identical.

Warning

Anaconda distribution and Miniconda are linked to Anaconda Terms of Service. They come with Anaconda’s defaults channels, which have a pay-for-user policy.

Please review the terms of service and only use Anaconda Repository if you understand the consequences.

To install conda and mamba, you should use the Miniforge3 installer as it comes with both and conda-forge as the configured channel.

To install micromamba, check the official documentation.

If you have conda already installed, you should run conda info to check the configured channels.

$ conda info
...
channel URLs : https://conda.anaconda.org/conda-forge/...
               https://conda.anaconda.org/conda-forge/noarch
...

Ensure you have conda-forge channel configured. It is the only channel you need to install all above packages. If https://repo.anaconda.com/pkgs/... is in your list of channels, you should remove it by editing your .condarc file. Refer to the official documentation.

Warning

When using conda or mamba, you should not install packages in the base environment. It is reserved for their dependencies. Always create a separate environment.

micromamba is a single executable and doesn’t come with a base environment.

To install tango-test and pytango, you can run:

$ conda create -y -n tango tango-test python=3.12 pytango
$ conda activate tango
(tango) $ TangoTest --help
(tango) $ python -c 'import tango; print(tango.utils.info())'

You can also run an executable in a conda environment without activating it:

$ conda run -n tango TangoTest --help

pixi#

Pixi is a package management tool for developers. It allows you to install libraries and applications in a reproducible way. It is also very convenient to install global tools.

Install pixi following the instructions on pixi website.

Installing global tools with pixi#

To install tools that aren’t linked to any project, you can use the pixi global command. Install jive, pogo, tango-database on your machine:

$ pixi global install jive pogo tango-database

This will create a separate environment for each of the application and make them available in your PATH. You can now invoke any of them (no activation needed):

$ jive

See https://pixi.sh/latest/reference/cli/#global-options for more information.

Working on projects#

audience:developers

When working on a project, pixi can manage environments for you.

If you clone a project with an existing pixi.toml file, like pytango repository, running pixi run will automatically create the defined environment.

If you work on a new project, create a pixi.toml file by running pixi init:

$ cd myproject
$ pixi init

You can then add all the requirements you need:

$ pixi add python=3.12 pytango

This will automatically update the pixi.toml file as well as a pixi.lock file and create the environment under the .pixi directory. You can use that environment by running pixi run or pixi shell to activate it.

$ pixi run python -c 'import tango; print(tango.utils.info())'
$ pixi shell
(myproject) $ python -c 'import tango; print(tango.utils.info())'

When using pixi shell, just enter exit to exit the shell.