-
Notifications
You must be signed in to change notification settings - Fork 104
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
conda-lock produces lock file which lists a package twice with different versions #540
Comments
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 |
I also have a similar problem. In my case, I specified the Here's the lock file I got: |
@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 |
It's due to a conflict between the conda and pip constraints. For example, you can trigger this explicitly. environment.ymlchannels:
- conda-forge
platforms:
- linux-64
dependencies:
- python =3.12
- click
- pip:
- click <8 conda-lock.ymlNotice that conda-lock.yml# This lock file was generated by conda-lock (https://github.com/conda/conda-lock). DO NOT EDIT!
#
# A "lock file" contains a concrete list of package versions (with checksums) to be installed. Unlike
# e.g. `conda env create`, the resulting environment will not change as new package versions become
# available, unless you explicitly update the lock file.
#
# Install this environment as "YOURENV" with:
# conda-lock install -n YOURENV --file conda-lock.yml
# To update a single package to the latest version compatible with the version constraints in the source:
# conda-lock lock --lockfile conda-lock.yml --update PACKAGE
# To re-solve the entire environment, e.g. after changing a version constraint in the source file:
# conda-lock -f environment.yml --lockfile conda-lock.yml
version: 1
metadata:
content_hash:
linux-64: 8fe44e7074f767a128775867f716711d0842cff47d3c6c275712c61570d37fa9
channels:
- url: conda-forge
used_env_vars: []
platforms:
- linux-64
sources:
- environment.yml
package:
- name: _libgcc_mutex
version: '0.1'
manager: conda
platform: linux-64
dependencies: {}
url: https://conda.anaconda.org/conda-forge/linux-64/_libgcc_mutex-0.1-conda_forge.tar.bz2
hash:
md5: d7c89558ba9fa0495403155b64376d81
sha256: fe51de6107f9edc7aa4f786a70f4a883943bc9d39b3bb7307c04c41410990726
category: main
optional: false
- name: _openmp_mutex
version: '4.5'
manager: conda
platform: linux-64
dependencies:
_libgcc_mutex: '0.1'
libgomp: '>=7.5.0'
url: https://conda.anaconda.org/conda-forge/linux-64/_openmp_mutex-4.5-2_gnu.tar.bz2
hash:
md5: 73aaf86a425cc6e73fcf236a5a46396d
sha256: fbe2c5e56a653bebb982eda4876a9178aedfc2b545f25d0ce9c4c0b508253d22
category: main
optional: false
- name: bzip2
version: 1.0.8
manager: conda
platform: linux-64
dependencies:
libgcc-ng: '>=12'
url: https://conda.anaconda.org/conda-forge/linux-64/bzip2-1.0.8-hd590300_5.conda
hash:
md5: 69b8b6202a07720f448be700e300ccf4
sha256: 242c0c324507ee172c0e0dd2045814e746bb303d1eb78870d182ceb0abc726a8
category: main
optional: false
- name: ca-certificates
version: 2023.11.17
manager: conda
platform: linux-64
dependencies: {}
url: https://conda.anaconda.org/conda-forge/linux-64/ca-certificates-2023.11.17-hbcca054_0.conda
hash:
md5: 01ffc8d36f9eba0ce0b3c1955fa780ee
sha256: fb4b9f4b7d885002db0b93e22f44b5b03791ef3d4efdc9d0662185a0faafd6b6
category: main
optional: false
- name: click
version: 8.1.7
manager: conda
platform: linux-64
dependencies:
__unix: ''
python: '>=3.8'
url: https://conda.anaconda.org/conda-forge/noarch/click-8.1.7-unix_pyh707e725_0.conda
hash:
md5: f3ad426304898027fc619827ff428eca
sha256: f0016cbab6ac4138a429e28dbcb904a90305b34b3fe41a9b89d697c90401caec
category: main
optional: false
- name: ld_impl_linux-64
version: '2.40'
manager: conda
platform: linux-64
dependencies: {}
url: https://conda.anaconda.org/conda-forge/linux-64/ld_impl_linux-64-2.40-h41732ed_0.conda
hash:
md5: 7aca3059a1729aa76c597603f10b0dd3
sha256: f6cc89d887555912d6c61b295d398cff9ec982a3417d38025c45d5dd9b9e79cd
category: main
optional: false
- name: libexpat
version: 2.5.0
manager: conda
platform: linux-64
dependencies:
libgcc-ng: '>=12'
url: https://conda.anaconda.org/conda-forge/linux-64/libexpat-2.5.0-hcb278e6_1.conda
hash:
md5: 6305a3dd2752c76335295da4e581f2fd
sha256: 74c98a563777ae2ad71f1f74d458a8ab043cee4a513467c159ccf159d0e461f3
category: main
optional: false
- name: libffi
version: 3.4.2
manager: conda
platform: linux-64
dependencies:
libgcc-ng: '>=9.4.0'
url: https://conda.anaconda.org/conda-forge/linux-64/libffi-3.4.2-h7f98852_5.tar.bz2
hash:
md5: d645c6d2ac96843a2bfaccd2d62b3ac3
sha256: ab6e9856c21709b7b517e940ae7028ae0737546122f83c2aa5d692860c3b149e
category: main
optional: false
- name: libgcc-ng
version: 13.2.0
manager: conda
platform: linux-64
dependencies:
_libgcc_mutex: '0.1'
_openmp_mutex: '>=4.5'
url: https://conda.anaconda.org/conda-forge/linux-64/libgcc-ng-13.2.0-h807b86a_3.conda
hash:
md5: 23fdf1fef05baeb7eadc2aed5fb0011f
sha256: 5e88f658e07a30ab41b154b42c59f079b168acfa9551a75bdc972099453f4105
category: main
optional: false
- name: libgomp
version: 13.2.0
manager: conda
platform: linux-64
dependencies:
_libgcc_mutex: '0.1'
url: https://conda.anaconda.org/conda-forge/linux-64/libgomp-13.2.0-h807b86a_3.conda
hash:
md5: 7124cbb46b13d395bdde68f2d215c989
sha256: 6ebedee39b6bbbc969715d0d7fa4b381cce67e1139862604ffa393f821c08e81
category: main
optional: false
- name: libnsl
version: 2.0.1
manager: conda
platform: linux-64
dependencies:
libgcc-ng: '>=12'
url: https://conda.anaconda.org/conda-forge/linux-64/libnsl-2.0.1-hd590300_0.conda
hash:
md5: 30fd6e37fe21f86f4bd26d6ee73eeec7
sha256: 26d77a3bb4dceeedc2a41bd688564fe71bf2d149fdcf117049970bc02ff1add6
category: main
optional: false
- name: libsqlite
version: 3.44.2
manager: conda
platform: linux-64
dependencies:
libgcc-ng: '>=12'
libzlib: '>=1.2.13,<1.3.0a0'
url: https://conda.anaconda.org/conda-forge/linux-64/libsqlite-3.44.2-h2797004_0.conda
hash:
md5: 3b6a9f225c3dbe0d24f4fedd4625c5bf
sha256: ee2c4d724a3ed60d5b458864d66122fb84c6ce1df62f735f90d8db17b66cd88a
category: main
optional: false
- name: libuuid
version: 2.38.1
manager: conda
platform: linux-64
dependencies:
libgcc-ng: '>=12'
url: https://conda.anaconda.org/conda-forge/linux-64/libuuid-2.38.1-h0b41bf4_0.conda
hash:
md5: 40b61aab5c7ba9ff276c41cfffe6b80b
sha256: 787eb542f055a2b3de553614b25f09eefb0a0931b0c87dbcce6efdfd92f04f18
category: main
optional: false
- name: libzlib
version: 1.2.13
manager: conda
platform: linux-64
dependencies:
libgcc-ng: '>=12'
url: https://conda.anaconda.org/conda-forge/linux-64/libzlib-1.2.13-hd590300_5.conda
hash:
md5: f36c115f1ee199da648e0597ec2047ad
sha256: 370c7c5893b737596fd6ca0d9190c9715d89d888b8c88537ae1ef168c25e82e4
category: main
optional: false
- name: ncurses
version: '6.4'
manager: conda
platform: linux-64
dependencies:
libgcc-ng: '>=12'
url: https://conda.anaconda.org/conda-forge/linux-64/ncurses-6.4-h59595ed_2.conda
hash:
md5: 7dbaa197d7ba6032caf7ae7f32c1efa0
sha256: 91cc03f14caf96243cead96c76fe91ab5925a695d892e83285461fb927dece5e
category: main
optional: false
- name: openssl
version: 3.2.0
manager: conda
platform: linux-64
dependencies:
ca-certificates: ''
libgcc-ng: '>=12'
url: https://conda.anaconda.org/conda-forge/linux-64/openssl-3.2.0-hd590300_1.conda
hash:
md5: 603827b39ea2b835268adb8c821b8570
sha256: 80efc6f429bd8e622d999652e5cba2ca56fcdb9c16a439d2ce9b4313116e4a87
category: main
optional: false
- name: pip
version: 23.3.1
manager: conda
platform: linux-64
dependencies:
python: '>=3.7'
setuptools: ''
wheel: ''
url: https://conda.anaconda.org/conda-forge/noarch/pip-23.3.1-pyhd8ed1ab_0.conda
hash:
md5: 2400c0b86889f43aa52067161e1fb108
sha256: 435829a03e1c6009f013f29bb83de8b876c388820bf8cf69a7baeec25f6a3563
category: main
optional: false
- name: python
version: 3.12.0
manager: conda
platform: linux-64
dependencies:
bzip2: '>=1.0.8,<2.0a0'
ld_impl_linux-64: '>=2.36.1'
libexpat: '>=2.5.0,<3.0a0'
libffi: '>=3.4,<4.0a0'
libgcc-ng: '>=12'
libnsl: '>=2.0.0,<2.1.0a0'
libsqlite: '>=3.43.0,<4.0a0'
libuuid: '>=2.38.1,<3.0a0'
libzlib: '>=1.2.13,<1.3.0a0'
ncurses: '>=6.4,<7.0a0'
openssl: '>=3.1.3,<4.0a0'
readline: '>=8.2,<9.0a0'
tk: '>=8.6.13,<8.7.0a0'
tzdata: ''
xz: '>=5.2.6,<6.0a0'
url: https://conda.anaconda.org/conda-forge/linux-64/python-3.12.0-hab00c5b_0_cpython.conda
hash:
md5: 7f97faab5bebcc2580f4f299285323da
sha256: 5398ebae6a1ccbfd3f76361eac75f3ac071527a8072627c4bf9008c689034f48
category: main
optional: false
- name: readline
version: '8.2'
manager: conda
platform: linux-64
dependencies:
libgcc-ng: '>=12'
ncurses: '>=6.3,<7.0a0'
url: https://conda.anaconda.org/conda-forge/linux-64/readline-8.2-h8228510_1.conda
hash:
md5: 47d31b792659ce70f470b5c82fdfb7a4
sha256: 5435cf39d039387fbdc977b0a762357ea909a7694d9528ab40f005e9208744d7
category: main
optional: false
- name: setuptools
version: 68.2.2
manager: conda
platform: linux-64
dependencies:
python: '>=3.7'
url: https://conda.anaconda.org/conda-forge/noarch/setuptools-68.2.2-pyhd8ed1ab_0.conda
hash:
md5: fc2166155db840c634a1291a5c35a709
sha256: 851901b1f8f2049edb36a675f0c3f9a98e1495ef4eb214761b048c6f696a06f7
category: main
optional: false
- name: tk
version: 8.6.13
manager: conda
platform: linux-64
dependencies:
libgcc-ng: '>=12'
libzlib: '>=1.2.13,<1.3.0a0'
url: https://conda.anaconda.org/conda-forge/linux-64/tk-8.6.13-noxft_h4845f30_101.conda
hash:
md5: d453b98d9c83e71da0741bb0ff4d76bc
sha256: e0569c9caa68bf476bead1bed3d79650bb080b532c64a4af7d8ca286c08dea4e
category: main
optional: false
- name: tzdata
version: 2023c
manager: conda
platform: linux-64
dependencies: {}
url: https://conda.anaconda.org/conda-forge/noarch/tzdata-2023c-h71feb2d_0.conda
hash:
md5: 939e3e74d8be4dac89ce83b20de2492a
sha256: 0449138224adfa125b220154408419ec37c06b0b49f63c5954724325903ecf55
category: main
optional: false
- name: wheel
version: 0.42.0
manager: conda
platform: linux-64
dependencies:
python: '>=3.7'
url: https://conda.anaconda.org/conda-forge/noarch/wheel-0.42.0-pyhd8ed1ab_0.conda
hash:
md5: 1cdea58981c5cbc17b51973bcaddcea7
sha256: 80be0ccc815ce22f80c141013302839b0ed938a2edb50b846cf48d8a8c1cfa01
category: main
optional: false
- name: xz
version: 5.2.6
manager: conda
platform: linux-64
dependencies:
libgcc-ng: '>=12'
url: https://conda.anaconda.org/conda-forge/linux-64/xz-5.2.6-h166bdaf_0.tar.bz2
hash:
md5: 2161070d867d1b1204ea749c8eec4ef0
sha256: 03a6d28ded42af8a347345f82f3eebdd6807a08526d47899a42d62d319609162
category: main
optional: false
- name: click
version: 7.1.2
manager: pip
platform: linux-64
dependencies: {}
url: https://files.pythonhosted.org/packages/d2/3d/fa76db83bf75c4f8d338c2fd15c8d33fdd7ad23a9b5e57eb6c5de26b430e/click-7.1.2-py2.py3-none-any.whl
hash:
sha256: dacca89f4bfadd5de3d7489b7c8a566eee0d3676333fbb50030263894c38c0dc
category: main
optional: false |
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
The text was updated successfully, but these errors were encountered: