Skip to content

environment.yml is unsatisfiable as written (mixed channels + pinned builds) and conflicts with pip torch==1.13.1 vs conda PyTorch 2.0/cu118 #33

@AllanK24

Description

@AllanK24

Hi! I’m trying to create the environment from environment.yml and keep hitting solver failures. The file looks like an exported env with many exact build pins and it mixes channel stacks; additionally the pip: section pins torch==1.13.1 while the conda deps specify torchaudio==2.0.2, torchvision==0.15.2, and pytorch-cuda==11.8 — which implies PyTorch 2.0.x, not 1.13.

What I ran

# from repo root
conda env create -n qsam -f environment.yml           # also tried --solver classic

What happened

Conda fails to solve with a large set of packages “excluded by strict repo priority”, e.g.

LibMambaUnsatisfiableError: Encountered problems while solving:

  • package _openmp_mutex-5.1-1_gnu is excluded by strict repo priority
  • package libgcc-ng-11.2.0-h1234567_1 is excluded by strict repo priority
  • package pillow-9.4.0-py311h6a678d5_0 is excluded by strict repo priority
  • package python-3.11.4-h955ad1f_0 is excluded by strict repo priority
    ... (many similar lines)

Why I think this happens

Channel order vs pinned builds
channels: lists pytorch, nvidia, conda-forge, defaults, but many deps are pinned to defaults builds (e.g. py311h6a678d5_0). With strict channel priority, those defaults builds get excluded because conda-forge sits above defaults. The solver can’t mix them.

Inconsistent PyTorch stack

Conda deps: torchaudio=2.0.2, torchvision=0.15.2, pytorch-cuda=11.8 → this corresponds to PyTorch 2.0.x.
Pip deps: torch==1.13.1 and several nvidia-cu11 wheels → these conflict with the conda CUDA 11.8 stack.

Suggested fixes

Any of these would make the env reproducible:

Provide a lean, channel-coherent environment.yml (GPU), e.g.

name: finetune-sam
channels: [pytorch, nvidia, defaults]
dependencies:
  - python=3.11
  - pip
  - pytorch=2.0.1
  - torchvision=0.15.2
  - torchaudio=2.0.2
  - pytorch-cuda=11.8
  - numpy
  - scipy
  - scikit-image
  - pillow
  - matplotlib
  - jupyterlab
  - ffmpeg
  - pip:
      - segment-anything==1.0
      - monai==1.2.0
      - torchio==0.19.1
      - pytorch-lightning==2.0.9.post0
      - timm==0.9.7
      - transformers==4.26.1
      - tokenizers==0.13.3
      - simpleitk==2.2.1
      - opencv-python==4.8.0.76
      - pandas==2.1.0
      - tensorboard==2.14.0
      - safetensors==0.3.3
      - einops==0.6.1

(Key points: keep torch out of pip, let conda provide the CUDA build, and avoid exact build strings.)

  • Or split into two files:
    environment.yml (conda-only, no pip torch); requirements-pip.txt (pip-only extras). In environment.yml, put defaults ahead of conda-forge or remove exact build pins so conda-forge can be first without strict-priority conflicts.

  • If you want to keep conda-forge first: remove exact build pins (export with conda env export --from-history) so the solver can pick compatible conda-forge builds.

  • Optional CPU-only variant (no NVIDIA dependency): drop nvidia channel and pytorch-cuda, and add cpuonly from pytorch if desired:

channels: [pytorch, defaults]
dependencies:
  - python=3.11
  - pip
  - pytorch=2.0.1
  - torchvision=0.15.2
  - torchaudio=2.0.2
  - cpuonly
  - ...

Environment

  • Platform: linux-64
  • Conda: (fill in) conda --version
  • Channel priority: strict
  • GPU/Driver: Driver Version: 550.163.01; CUDA Version: 12.4

I’m happy to open a PR with a cleaned environment.yml if this direction sounds good. Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions