Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prune impossible packages before solving #1578

Closed
dhirschfeld opened this issue Mar 15, 2022 · 5 comments
Closed

Prune impossible packages before solving #1578

dhirschfeld opened this issue Mar 15, 2022 · 5 comments

Comments

@dhirschfeld
Copy link
Contributor

dhirschfeld commented Mar 15, 2022

I'm wondering if pruning the repodata before solving might result in better error messages when things go wrong.

The solver error messages are definitely a lot better than previously but, when things do go wrong in a complex environment the user is still often presented with a misleading error message.

In the example below I was trying to update perspective and got an error message about numpy not being available:

❯ mamba install perspective=1.3.1

Encountered problems while solving:
  - package perspective-1.3.1-py310h97c1f61_0 requires numpy >=1.22.2,<2.0a0, but none of the providers can be installed

numpy obviously was available but trying to install it gave an error about py39 when my environment was py310:

❯ mamba install numpy=1.22.3

Encountered problems while solving:
  - package numba-0.53.0-py39h4292f66_0 requires python >=3.9,<3.10.0a0, but none of the providers can be installed

This is obviously a red-herring as the solver should never choose a package with an incompatible Python version.

I'm wondering if this type of error could be avoided altogether if any packages with incompatible python versions were pruned from the repodata before being passed to the solver?

@dhirschfeld
Copy link
Contributor Author

Helping the solver out a little by explicitly pinning the python version eventually resulted in a meaningful error message:

❯ mamba install numpy=1.22.3 numba=0.55.1=py310hc55943c_0

Encountered problems while solving:
  - package numpy-1.22.3-py39h18676bf_0 requires python >=3.9,<3.10.0a0, but none of the providers can be installed
❯ mamba install numpy=1.22.3=py310h45f3432_0 numba=0.55.1=py310hc55943c_0

Encountered problems while solving:
  - package numba-0.55.1-py310hc55943c_0 has constraint numpy >=1.18,<1.22 conflicting with numpy-1.22.3-py310h45f3432_0

i.e. my numba requires numpy<1.22 but perspective needs numpy>=1.22.2

@dhirschfeld
Copy link
Contributor Author

Anyway, just thought I'd document this in case it's useful. I don't think there's anything directly actionable here so feel free to note and close.

@dhirschfeld
Copy link
Contributor Author

Assuming this is possible it might help improve the error message in situations such as in #1587

@wolfv
Copy link
Member

wolfv commented Mar 24, 2022

@dhirschfeld we've recently exposed additional structured information that the solver can give to Python. Now we need to find someone well versed in graph theory to see if we can exploit the additional error information to get better messages ... :)

@dhirschfeld
Copy link
Contributor Author

I'll go ahead and close this since it's just random musings and it sounds like you've already got a path towards a (better) solution.

Unfortunately, my graph theory is non-existent so I'll just eagerly watch from the sidelines! 😄 👀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants