Skip to content

Support target platform specification (e.g., --platform/--subdir) in conda env update and conda update commands #14949

@bentyeh

Description

@bentyeh

Checklist

  • I added a descriptive title
  • I searched open requests and couldn't find a duplicate

What is the idea?

Support user specification of a target platform when trying to update packages in an environment.

Why is this needed?

Since at least version 24.3.0, users have been able to create environments with packages compiled for different platforms (architectures). Specifically, conda env create and conda create commands have supported --platform/--subdir options. This is particularly useful for Apple Silicon (ARM-based) Mac users (osx-arm64 platform) trying to install packages only available for the osx-64 platform, which can still be run on ARM-based Macs through Rosetta.

However, no similar target platform options currently exist for updating packages, whether via conda env update or conda update.

What should happen?

conda env update and conda update should support --platform and/or --subdir options.

Additional Context

There are currently at least 2 workarounds for updating packages targeting a different platform. Here, I assume that the environment.yaml file has been updated since the environment was initially created.

  1. Remove and re-create the environment.

    conda env remove -y -n myenv
    
    # example targeting the osx-64 platform
    conda env create --platform osx-64 -f environment.yaml
  2. Set the subdir conda config variable.

    • This was the main way to create environments targeting different platforms in older versions of conda, which was superseded by the --platform or --subdir options to conda env create and conda create. Unfortunately, this remains necessary for updating packages (if you don't want to remove and re-create the environment).
    # example targeting the osx-64 platform
    config --env --set subdir osx-64
    
    conda env update -f environment.yaml

Metadata

Metadata

Labels

plugins::envpertains to conda-envseverity::1blocker; broken functionality with no workaroundsource::communitycatch-all for issues filed by community memberstype::bugdescribes erroneous operation, use severity::* to classify the type

Type

No type

Projects

Status

🏁 Done

Status

Done 💪🏾

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions