Open FelixSchwarz opened 8 months ago
Thanks a lot for the report. There is unfortunately some really gnarly logic around the handling of mixed conda/pip requirements. One of my goals is to rewrite it to make it clear what's going on so that these sorts of issues can be diagnosed, but realistically that's probably a ways off. I could definitely use any help!
Regarding #524 it just needs to be tested. If you could certify that the alphabetized lockfiles install correctly with conda-lock >=1.0.5
and micromamba >=1.0.0
then we could get that merged and released promptly.
I also have a similar problem.
In my case, I specified the pytorch
version to 2.0.1
. But in the pip
dependencies, a new pytorch
version is locked. It seems conda-lock
doesn't respect the version compat set in the conda
section. The result is, first the explicitly specified version is installed through micromamba
, and then it is upgrade to the one set in the pip dependencies.
Here's the lock file I got: conda-lock.txt
@findmyway, thanks for the report. Could you please also provide the corresponding source files so that I can reproduce your lockfile?
@findmyway, thanks for the report. Could you please also provide the corresponding source files so that I can reproduce your lockfile?
Strange, I modified the original pyproject.toml
file multiple times and I couldn't reproduce it now 😢
It's due to a conflict between the conda and pip constraints. For example, you can trigger this explicitly.
channels:
- conda-forge
platforms:
- linux-64
dependencies:
- python =3.12
- click
- pip:
- click <8
Notice that click
is included twice.
Checklist
What happened?
In some situations
conda-lock
produces a lock file which lists a package twice, with different versions and different sources. In my case I pinned theonnx
package from conda-forge to version 1.13.1 but the pip dependencies somehow add onnx 1.14.1 (which is the latest released version).I expected the
onnx
package to be added only once (using the pinned version 1.13.1). If this version does not satisfy all requirements the user should see an error when creating the lock file.Btw: If #524 had been merged, I would have noticed the problem much earlier using
git diff
.Conda Info
Conda Config
Conda list