Cornelius Roemer
Cornelius Roemer

Reputation: 7989

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?

Upvotes: 1

Views: 860

Answers (2)

merv
merv

Reputation: 76810

The CONDA_SUBDIR variable works well for this. For example,

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

Upvotes: 4

Cornelius Roemer
Cornelius Roemer

Reputation: 7989

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

Upvotes: 1

Related Questions