installing pytorch to one conda evnironment removes existing installation from other conda environments

Viewed 191

The pip was installed per each environment and which pip returns proper(and different) location for different conda environments. I am not using any external scripts for the installation. It's vanilla pip install and also tried python -m pip install. Also tried to install with conda. In all of these cases, installing it for env1 will uninstall it from env2 and vice versa. No matter from which env I am installing, all envs will use the same version that was installed last.

Not sure if it's relevant, but I am using WSL2.

What could go wrong? What else should I check?

1 Answers

I still have no idea what is causing this behavior but at least found a workaround - using pip --ignore-installed option:

conda activate your_target_env
pip install --ignore-installed torch torchvision torchaudio

This will not uninstall other versions of pytorch installed inside other conda environments. And both environments will work with their versions of pytorch.

Related