Open hrz6976 opened 1 month ago
This is a shortcoming of how we solve mixed conda and pypi dependencies. We first solve all conda dependencies and use that as input to solve the pypi packages. Conda package are pinned so versions cannot be changed by the pypi solve.
As you already deduced, tqdm
is solved by the conda solver to version 4.66.5
, but that version is incompatible with the requirement from multimodal-transformers
so the solve fails.
Possible solutions are (in order of personal preference):
1 Limit tqdm
to the same constraints as multimodal-transformers
. e.g. pixi add tqdm~=4.64.1
2 Install tqdm
from pypi too. e.g. pixi remove tqdm && pixi add tqdm --pypi
3 Add multimodal-transformers
as a conda package by adding it to conda-forge
This is a shortcoming of how we solve mixed conda and pypi dependencies. We first solve all conda dependencies and use that as input to solve the pypi packages. Conda package are pinned so versions cannot be changed by the pypi solve.
As you already deduced,
tqdm
is solved by the conda solver to version4.66.5
, but that version is incompatible with the requirement frommultimodal-transformers
so the solve fails.Possible solutions are (in order of personal preference):
1 Limit
tqdm
to the same constraints asmultimodal-transformers
. e.g.pixi add tqdm~=4.64.1
2 Install
tqdm
from pypi too. e.g.pixi remove tqdm && pixi add tqdm --pypi
3 Add
multimodal-transformers
as a conda package by adding it to conda-forge
Thanks for the timely response š! Do you think it will be better to address this limitation and the solution somewhere in the docs so that others won't get confused?
I know it's unrelated to the sole matter of this issue, but can you imagine it being possible to solve pypi and conda packages together in the future? If I remember correctly, that was in the scope with rip
, but there was communication that it's not so simple with uv
solving pypi.
From my experience, most of the issues with environments is caused by this specific scenario. --frozen
gives a lot of stability, so existing envs don't break, but it's still an issue when changing environment or just some packages with "*" versions getting updates. First solving conda -> then pypi failing because of different constraints.
On the other hand, often there is very simple quickfix - adding the constraints for the conflicting dependency to conda
section, so the 1 solution from your list.
Exactly my issue recently with most packages bumping up to numpy 2.0 and some pypi package still constrained by <2.0. Maybe there would be possibility to automate addition of numpy ~=1.0 to conda dependencies?
Verbosity for the pypi failures is now much better than before, but it's also somehow not concrete. I like the error telling me that e.g. Tensorflow 2.15 requires numpy 2>x>lower and current numpy from conda is 2.0.1, but there is no clear information (without going through all -vvv log) how numpy 2.0.1 even got there in first place without being explicit in manifest. Could be helpful if there was also a list of conda
packages with numpy
dependency causing this conflict point. This way user could know what packages versions he might need to change manually to support constraints from pypi section if 1 solution wont work.
I know it's very sloppy wording with no direct solution, but for me it seems like there is still a possibility to improve UX with environment setup.
Thanks for your input @niemiaszek, we know of this problem well but have yet to find a good solution to this issue.
That said, even with a cross ecosystem solve solution it is still going to be best to get everything from conda-forge
as that is a much more stable distribution and there is guaranteed ABI compatibility. The current message to the community is to help yourself and everyone else by contributing to conda-forge
and make the packages you need from pypi
a conda
package.
@ruben-arts I think the actionable part of this issue is to clarify this in the docs? Or is it already somewhere?
Checks
[X] I have checked that this issue has not already been reported.
[X] I have confirmed this bug exists on the latest version of pixi, using
pixi --version
.Reproducible example
Issue description
I'm trying to migrate a conda project to pixi, and surprised to find that multimodal-transformers and tqdm can not be installed together š®. From the logs, seems that pixi thinks I'm requiring tqdm==4.66.5 (latest version) when I
pixi add tqdm
, which conflicts withtqdm~=4.64.1
; pip recognizes in this case and installstqdm==4.64.1
.Output from
pixi add tqdm -vvv
:Requirements of multimodal-transformers:
Expected behavior
Tqdm can be installed.