Skip to content

Print a help when a package was not found #3026

Open
@ruben-arts

Description

@ruben-arts

Problem description

Issue

When running pixi global install bla or pixi add bla you'll get an error message that is not really helping the user going forward.

> pixi add bla
Error: 
  × failed to solve the conda requirements of 'default' 'win-64'
  ╰─▶ Cannot solve the request because of: No candidates were found for bla *.

Solution

What would be much better is to execute a search and print similar packages and add a help message with options to figure out what to do next.

For example:

> pixi add bla
 ×  No candidates were found for bla * for 'win-64'.

  Did you mean one of these?
    - blaz (1.2.3)
    - bla-tools (0.8.1)
    - bla-lib (2.1.0)

  Tip: Run `pixi search bla` to explore available packages.

We have a similarity implementation in our TomlError:

TomlError::TomlError(toml_span::Error { kind, .. }) => match kind {
which could be reused as the algoritm for this implementation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    UXRelated to the User Experience of pixicliIssue related to CLIgood first issueGood for newcomers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions