Skip to content

feat(add): --channel parameter #4594

@maoyibo

Description

@maoyibo

Problem description

Problem description

pixi add command add --channel parameters to specifying the channel when adding dependencies.

conda channel

When using pixi to install packages from specialized channels such as bioconda, the channel must first be added to workspace.channels; otherwise, resolution errors will occur.
Empty pixi.toml

[workspace]
authors = ["Yibo Mao <maoyibo@gmail.com>"]
channels = ["conda-forge"]
name = "add-test"
platforms = ["linux-64"]
version = "0.1.0"

[tasks]

[dependencies]
python = ">=3.13.7,<3.14"
pixi add samtools
Error:   × failed to solve requirements of environment 'default' for platform 'linux-64'
  ├─▶   × failed to solve the environment
  │   
  ╰─▶ Cannot solve the request because of: No candidates were found for samtools *.

By adding the --channel parameter, the specified channel is automatically added to workspace.channels and the package is constrained to that specific channel.

--channel parameter works as follows:

pixi add --channel bioconda samtools

Updated pixi.toml

[workspace]
authors = ["Yibo Mao <maoyibo@gmail.com>"]
channels = ["conda-forge", "bioconda"]
name = "add-test"
platforms = ["linux-64"]
version = "0.1.0"

[tasks]

[dependencies]
python = ">=3.13.7,<3.14"
samtools = { version = ">=1.22.1,<2", channel = "bioconda" }

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions