conda / conda-lock

Lightweight lockfile for conda environments
https://conda.github.io/conda-lock/
Other
499 stars 104 forks source link

pip integration: The dependency name for ... does not match the actual package's name #489

Open mjlbach opened 1 year ago

mjlbach commented 1 year ago

Checklist

What happened?

environment.yaml

channels:
  - defaults
  - pytorch
  - nvidia
  - fvcore
  - iopath
  - conda-forge
dependencies:
  - python=3.10
  - pip
  - pytorch=2.0.1=py3.10_cuda11.8_cudnn8.7.0_0
  - torchvision=0.15.2=py310_cu118
  - pytorch-cuda=11.8
  - fvcore
  - iopath
  - pip:
    - https://dl.fbaipublicfiles.com/pytorch3d/packaging/wheels/py310_cu118_pyt201/pytorch3d-0.7.4-cp310-cp310-linux_x86_64.whl

conda-lock yields

❯ conda-lock
/home/michael/.local/pipx/venvs/conda-lock/lib/python3.10/site-packages/pydantic/_internal/_config.py:269: UserWarning: Valid config keys have changed in V2:
* 'allow_mutation' has been removed
  warnings.warn(message, UserWarning)
Locking dependencies for ['linux-64', 'osx-64', 'win-64']...
INFO:conda_lock.conda_solver:linux-64 using specs ['python 3.10.*', 'pip *', 'pytorch 2.0.1 py3.10_cuda11.8_cudnn8.7.0_0', 'torchvision 0.15.2 py310_cu118', 'pytorch-cuda 11.8.*', 'fvcore', 'iopath']
Traceback (most recent call last):
  File "/home/michael/.local/bin/conda-lock", line 8, in <module>
    sys.exit(main())
  File "/home/michael/.local/pipx/venvs/conda-lock/lib/python3.10/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
  File "/home/michael/.local/pipx/venvs/conda-lock/lib/python3.10/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
  File "/home/michael/.local/pipx/venvs/conda-lock/lib/python3.10/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/michael/.local/pipx/venvs/conda-lock/lib/python3.10/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/michael/.local/pipx/venvs/conda-lock/lib/python3.10/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
  File "/home/michael/.local/pipx/venvs/conda-lock/lib/python3.10/site-packages/click/decorators.py", line 33, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/home/michael/.local/pipx/venvs/conda-lock/lib/python3.10/site-packages/conda_lock/conda_lock.py", line 1332, in lock
    lock_func(
  File "/home/michael/.local/pipx/venvs/conda-lock/lib/python3.10/site-packages/conda_lock/conda_lock.py", line 1040, in run_lock
    make_lock_files(
  File "/home/michael/.local/pipx/venvs/conda-lock/lib/python3.10/site-packages/conda_lock/conda_lock.py", line 381, in make_lock_files
    lock_content = lock_content | create_lockfile_from_spec(
  File "/home/michael/.local/pipx/venvs/conda-lock/lib/python3.10/site-packages/conda_lock/conda_lock.py", line 787, in create_lockfile_from_spec
    deps = _solve_for_arch(
  File "/home/michael/.local/pipx/venvs/conda-lock/lib/python3.10/site-packages/conda_lock/conda_lock.py", line 721, in _solve_for_arch
    pip_deps = solve_pypi(
  File "/home/michael/.local/pipx/venvs/conda-lock/lib/python3.10/site-packages/conda_lock/pypi_solver.py", line 335, in solve_pypi
    result = s.solve(use_latest=to_update)
  File "/home/michael/.local/pipx/venvs/conda-lock/lib/python3.10/site-packages/conda_lock/_vendor/poetry/puzzle/solver.py", line 65, in solve
    packages, depths = self._solve(use_latest=use_latest)
  File "/home/michael/.local/pipx/venvs/conda-lock/lib/python3.10/site-packages/conda_lock/_vendor/poetry/puzzle/solver.py", line 233, in _solve
    result = resolve_version(
  File "/home/michael/.local/pipx/venvs/conda-lock/lib/python3.10/site-packages/conda_lock/_vendor/poetry/mixology/__init__.py", line 7, in resolve_version
    return solver.solve()
  File "/home/michael/.local/pipx/venvs/conda-lock/lib/python3.10/site-packages/conda_lock/_vendor/poetry/mixology/version_solver.py", line 84, in solve
    next = self._choose_package_version()
  File "/home/michael/.local/pipx/venvs/conda-lock/lib/python3.10/site-packages/conda_lock/_vendor/poetry/mixology/version_solver.py", line 400, in _choose_package_version
    version = self._provider.complete_package(version)
  File "/home/michael/.local/pipx/venvs/conda-lock/lib/python3.10/site-packages/conda_lock/_vendor/poetry/puzzle/provider.py", line 454, in complete_package
    self.search_for_url(r)
  File "/home/michael/.local/pipx/venvs/conda-lock/lib/python3.10/site-packages/conda_lock/_vendor/poetry/puzzle/provider.py", line 307, in search_for_url
    raise RuntimeError(
RuntimeError: The dependency name for pytorch3d-0-7-4-cp310-cp310-linux-x86-64-whl does not match the actual package's name: pytorch3d

Conda Info

No response

Conda Config

No response

Conda list

No response

Additional Context

This is related to https://github.com/conda/conda-lock/issues/488, one of the approaches is required for supporting pytorch3D via pip

maresb commented 1 year ago

Thanks a lot @mjlbach for these bug reports! I think the next step will be for me to finishing vendoring Poetry and see how many of these errors it fixes. I'm traveling for the next few weeks though.

mjlbach commented 1 year ago

Sorry for the deluge @maresb! Just wanted to provide a bunch of test cases

maresb commented 1 year ago

No apologies, I really do appreciate it, and it will be very helpful for building tests!

chuckwondo commented 10 months ago

I'm running into this same issue, and it looks like it's a Poetry bug that was fixed in Poetry 1.0.0: https://github.com/python-poetry/poetry/issues/1405

Any updates here?

maresb commented 10 months ago

Poetry still needs to be revendored. :disappointed:

Currently #390 has top priority. I want to do the revendoring soon afterwards, but unfortunately there is no timeline.

chuckwondo commented 10 months ago

No worries. Thanks for the prompt reply, and for an awesome tool. I can manage with a sub-optimal alternative approach until this issue is addressed.