Package pytorch conflicts during installation with Conda

username: Raphy
cooked: <p>I’m trying to install PyTorch through conda but I’m getting “conflict” errors:</p>
<p>I first activated the conda virtualenvironment:</p>
<pre><code>(base) raphy@pc:~$ source activate pytorch_env
</code></pre>
<p>Then, tried to install the packages:</p>
<pre><code>(pytorch_env) raphy@pc:~$ conda install -n pytorch_env pytorch torchvision torchaudio cpuonly -c pytorch
Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.
Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: / 
Found conflicts! Looking for incompatible packages.
This can take several minutes.  Press CTRL-C to abort.
failed                                                                                                                                                                                       

UnsatisfiableError: The following specifications were found to be incompatible with each other:

Output in format: Requested package -&gt; Available versions

Package pytorch conflicts for:
torchvision -&gt; pytorch[version='1.1.*|1.2.0+cu92|1.2.0|1.3.0|1.3.1|1.4.0|1.5.0|1.5.1|1.6.0|1.7.0|1.7.1|1.8.0|1.8.1|&gt;=1.1.0|&gt;=1.0.0|&gt;=0.4|&gt;=0.3|1.7.1.*|1.3.1.*|1.2.0.*']
torchaudio -&gt; pytorch[version='1.2.0|1.3.0|1.3.1|1.4.0|1.5.0|1.5.1|1.6.0|1.7.0|1.7.1|1.8.0|1.8.1|&gt;=1.1.0']
pytorch

Package six conflicts for:
pytorch -&gt; mkl-service[version='&gt;=2,&lt;3.0a0'] -&gt; six
torchvision -&gt; six

Package _libgcc_mutex conflicts for:
torchvision -&gt; libgcc-ng[version='&gt;=7.3.0'] -&gt; _libgcc_mutex=[build=main]
pytorch -&gt; libgcc-ng[version='&gt;=7.3.0'] -&gt; _libgcc_mutex=[build=main]
python=3.9 -&gt; libgcc-ng[version='&gt;=7.3.0'] -&gt; _libgcc_mutex=[build=main]

(pytorch_env) raphy@pc:~$ 
</code></pre>
<p>If I install it with pip3 it seems working fine:</p>
<pre><code>(pytorch_env) raphy@pc:~$ pip3 install torch==1.8.1+cpu torchvision==0.9.1+cpu torchaudio==0.8.1 -f https://download.pytorch.org/whl/torch_stable.html
Looking in links: https://download.pytorch.org/whl/torch_stable.html
Collecting torch==1.8.1+cpu
  Downloading https://download.pytorch.org/whl/cpu/torch-1.8.1%2Bcpu-cp39-cp39-linux_x86_64.whl (169.1 MB)
     |████████████████████████████████| 169.1 MB 126 kB/s 
Collecting torchvision==0.9.1+cpu
  Downloading https://download.pytorch.org/whl/cpu/torchvision-0.9.1%2Bcpu-cp39-cp39-linux_x86_64.whl (13.3 MB)
     |████████████████████████████████| 13.3 MB 37.6 MB/s 
Collecting torchaudio==0.8.1
  Downloading torchaudio-0.8.1-cp39-cp39-manylinux1_x86_64.whl (1.9 MB)
     |████████████████████████████████| 1.9 MB 14.3 MB/s 
Requirement already satisfied: numpy in ./anaconda3/envs/pytorch_env/lib/python3.9/site-packages (from torch==1.8.1+cpu) (1.20.1)
Requirement already satisfied: typing-extensions in ./anaconda3/envs/pytorch_env/lib/python3.9/site-packages (from torch==1.8.1+cpu) (3.7.4.3)
Requirement already satisfied: pillow&gt;=4.1.1 in ./anaconda3/envs/pytorch_env/lib/python3.9/site-packages (from torchvision==0.9.1+cpu) (8.2.0)
Installing collected packages: torch, torchvision, torchaudio
  Attempting uninstall: torch
    Found existing installation: torch 1.8.1
    Uninstalling torch-1.8.1:
      Successfully uninstalled torch-1.8.1
Successfully installed torch-1.8.1+cpu torchaudio-0.8.1 torchvision-0.9.1+cpu
(pytorch_env) raphy@pc:~$ cd pythonMatters/
(pytorch_env) raphy@pc:~/pythonMatters$ ls -lah
total 12K
drwxrwxr-x  2 raphy raphy 4,0K mag 31 16:54 .
drwxr-xr-x 39 raphy raphy 4,0K mag 31 17:22 ..
-rw-rw-r--  1 raphy raphy   44 mag 31 16:54 pytorch_verification.py
(pytorch_env) raphy@pc:~/pythonMatters$ nano pytorch_verification.py 
(pytorch_env) raphy@pc:~/pythonMatters$ python3 pytorch_verification.py 
tensor([[0.3230, 0.9078, 0.4617],
        [0.8623, 0.9219, 0.2986],
        [0.1736, 0.4657, 0.5214],
        [0.8163, 0.1591, 0.7434],
        [0.1205, 0.6854, 0.3539]])
(pytorch_env) raphy@pc:~/pythonMatters$ 
</code></pre>
<p>OS: Ubuntu 20.04 Desktop<br>
python: Python 3.9.4<br>
PyTorch Build: 1.8.1<br>
conda 4.10.1</p>