Search code examples
pythoncondacross-platformvirtual-environmentmamba

How do I tell conda/mamba to use windows/linux/osx channels that are different from the system OS?


I would like to help someone solve their problem with installing a particular mamba environment: New mamba environment force torch CPU and I don't know why

However, they use Windows, and I am on macOS.

How can I tell mamba to use pytorch/win-64 and conda-forge/win-64 channels instead of osx-arm subchannels?

I know I can specify channels using -c but how do I specify the system subdirectory?


Solution

  • The CONDA_SUBDIR variable works well for this. For example,

    CONDA_SUBDIR=win-64 mamba create -dn foo -c pytorch -c conda-forge pytorch