1

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?

Cornelius Roemer
  • 3,772
  • 1
  • 24
  • 55

2 Answers2

2

The CONDA_SUBDIR variable works well for this. For example,

CONDA_SUBDIR=win-64 mamba create -dn foo -c pytorch -c conda-forge pytorch
merv
  • 67,214
  • 13
  • 180
  • 245
  • So `CONDA_SUBDIR` does two things: set `--override-channels` and adds `win-64` as channel. Great to know - it was almost mystical to me how it worked. – Cornelius Roemer Nov 01 '22 at 12:19
  • 1
    No, it doesn't imply `--override-channels`; just avoids having to specify both a platform-specific subdirectory to channel arguments (including `noarch`). – merv Nov 01 '22 at 14:47
  • Got it, it only overrides the subdir (e.g. `osx-64`) part but not the channel-proper. – Cornelius Roemer Nov 01 '22 at 17:53
0

One simply needs to add the subdirectory to the channel, like -c conda-forge/win-64 and use --override-channels as well to make sure the default channels are not used.

To emulate mamba running on windows, this works:

mamba create -n test -c pytorch/win-64 -c conda-forge/win-64 -c conda-forge/noarch --override-channels pytorch

Cornelius Roemer
  • 3,772
  • 1
  • 24
  • 55