Not being install PyTorch

username: daddyodevil
cooked: <p>I am not being able to install PyTorch, I am getting an error about conflicting packages, although it is a new conda environment.</p>
<p>Created env using -<br>
<code>conda create --prefix ./ ipykernel -y</code></p>
<p>List of installed packages -</p>
<pre><code class="lang-auto"># packages in environment at /home/ayan/data/conda_envs/jovian_fcc:
#
# Name                    Version                   Build  Channel
_libgcc_mutex             0.1                        main  
backcall                  0.2.0              pyhd3eb1b0_0  
ca-certificates           2021.4.13            h06a4308_1  
certifi                   2020.12.5        py39h06a4308_0  
decorator                 5.0.9              pyhd3eb1b0_0  
ipykernel                 5.3.4            py39hb070fc8_0  
ipython                   7.22.0           py39hb070fc8_0  
ipython_genutils          0.2.0              pyhd3eb1b0_1  
jedi                      0.17.2           py39h06a4308_1  
jupyter_client            6.1.12             pyhd3eb1b0_0  
jupyter_core              4.7.1            py39h06a4308_0  
ld_impl_linux-64          2.33.1               h53a641e_7  
libffi                    3.3                  he6710b0_2  
libgcc-ng                 9.1.0                hdf63c60_0  
libsodium                 1.0.18               h7b6447c_0  
libstdcxx-ng              9.1.0                hdf63c60_0  
ncurses                   6.2                  he6710b0_1  
openssl                   1.1.1k               h27cfd23_0  
parso                     0.7.0                      py_0  
pexpect                   4.8.0              pyhd3eb1b0_3  
pickleshare               0.7.5           pyhd3eb1b0_1003  
pip                       21.1.1           py39h06a4308_0  
prompt-toolkit            3.0.17             pyh06a4308_0  
ptyprocess                0.7.0              pyhd3eb1b0_2  
pygments                  2.9.0              pyhd3eb1b0_0  
python                    3.9.5                hdb3f193_3  
python-dateutil           2.8.1              pyhd3eb1b0_0  
pyzmq                     20.0.0           py39h2531618_1  
readline                  8.1                  h27cfd23_0  
setuptools                52.0.0           py39h06a4308_0  
six                       1.15.0           py39h06a4308_0  
sqlite                    3.35.4               hdfb4753_0  
tk                        8.6.10               hbc83047_0  
tornado                   6.1              py39h27cfd23_0  
traitlets                 5.0.5              pyhd3eb1b0_0  
tzdata                    2020f                h52ac0ba_0  
wcwidth                   0.2.5                      py_0  
wheel                     0.36.2             pyhd3eb1b0_0  
xz                        5.2.5                h7b6447c_0  
zeromq                    4.3.4                h2531618_0  
zlib                      1.2.11               h7b6447c_3
</code></pre>
<p>All of the three following installation commands give same error -</p>
<pre><code class="lang-auto">conda install pytorch torchvision torchaudio cudatoolkit -c pytorch -c nvidia
conda install pytorch torchvision torchaudio cudatoolkit=11.1 -c pytorch -c nvidia
conda install pytorch torchvision torchaudio cudatoolkit=11.2 -c pytorch -c nvidia
</code></pre>
<p>I am getting the following error if I am not specifying cudatoolkit version -</p>
<pre><code class="lang-auto">
 ➜ conda install pytorch torchvision torchaudio cudatoolkit -c pytorch -c nvidia                                                                                        [127]
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 libstdcxx-ng conflicts for:
cudatoolkit -&gt; libstdcxx-ng[version='&gt;=7.3.0|&gt;=9.3.0']
pytorch -&gt; cudatoolkit[version='&gt;=11.1,&lt;11.2'] -&gt; libstdcxx-ng[version='&gt;=7.2.0|&gt;=9.3.0']
python=3.9 -&gt; libstdcxx-ng[version='&gt;=7.3.0']
torchvision -&gt; libstdcxx-ng[version='&gt;=5.4.0|&gt;=7.3.0']
torchvision -&gt; cudatoolkit[version='&gt;=11.1,&lt;11.2'] -&gt; libstdcxx-ng[version='&gt;=7.2.0|&gt;=9.3.0']
pytorch -&gt; libstdcxx-ng[version='&gt;=5.4.0|&gt;=7.3.0']
torchaudio -&gt; python[version='&gt;=3.9,&lt;3.10.0a0'] -&gt; libstdcxx-ng[version='&gt;=5.4.0|&gt;=7.2.0|&gt;=7.3.0']

Package cudatoolkit conflicts for:
pytorch -&gt; cudatoolkit[version='10.0.*|8.*|&gt;=10.0,&lt;10.1|&gt;=10.1,&lt;10.2|&gt;=11.1,&lt;11.2|&gt;=10.2,&lt;10.3|&gt;=11.0,&lt;11.1|&gt;=9.2,&lt;9.3|&gt;=9.0,&lt;9.1|&gt;=8.0,&lt;8.1|9.*|&gt;=10.1.243,&lt;10.2.0a0|&gt;=9.2,&lt;9.3.0a0|&gt;=10.0.130,&lt;10.1.0a0|9.2.*|&gt;=9.0,&lt;9.1.0a0|&gt;=8.0,&lt;8.1.0a0|9.0.*|8.0.*|7.5.*']
torchvision -&gt; cudatoolkit[version='&gt;=10.0,&lt;10.1|&gt;=10.1,&lt;10.2|&gt;=11.1,&lt;11.2|&gt;=10.2,&lt;10.3|&gt;=11.0,&lt;11.1|&gt;=9.2,&lt;9.3|&gt;=9.0,&lt;9.1|&gt;=10.0.130,&lt;10.1.0a0|&gt;=9.2,&lt;9.3.0a0|&gt;=9.0,&lt;9.1.0a0']
torchvision -&gt; pytorch==1.4.0 -&gt; cudatoolkit[version='10.0.*|&gt;=10.1.243,&lt;10.2.0a0|9.2.*|&gt;=8.0,&lt;8.1|&gt;=8.0,&lt;8.1.0a0|8.*|9.*|9.0.*|8.0.*|7.5.*']
cudatoolkit
torchaudio -&gt; pytorch==1.8.1 -&gt; cudatoolkit[version='10.0.*|&gt;=10.0,&lt;10.1|&gt;=10.1,&lt;10.2|&gt;=11.1,&lt;11.2|&gt;=10.2,&lt;10.3|&gt;=11.0,&lt;11.1|&gt;=9.2,&lt;9.3|&gt;=10.1.243,&lt;10.2.0a0|&gt;=9.2,&lt;9.3.0a0|&gt;=10.0.130,&lt;10.1.0a0|9.2.*|&gt;=9.0,&lt;9.1|&gt;=9.0,&lt;9.1.0a0']

Package nccl conflicts for:
torchvision -&gt; pytorch[version='&gt;=0.4'] -&gt; nccl[version='&lt;2']
pytorch -&gt; nccl[version='&lt;2']

Package pytorch conflicts for:
pytorch
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.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']

Package _libgcc_mutex conflicts for:
cudatoolkit -&gt; libgcc-ng[version='&gt;=7.3.0'] -&gt; _libgcc_mutex=[build=main]
torchvision -&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 -&gt; libgcc-ng[version='&gt;=7.3.0'] -&gt; _libgcc_mutex=[build=main]The following specifications were found to be incompatible with your system:

  - feature:/linux-64::__glibc==2.33=0
  - feature:|@/linux-64::__glibc==2.33=0
  - pytorch -&gt; cudatoolkit[version='&gt;=11.1,&lt;11.2'] -&gt; __glibc[version='&gt;=2.17,&lt;3.0.a0']
  - torchvision -&gt; cudatoolkit[version='&gt;=11.1,&lt;11.2'] -&gt; __glibc[version='&gt;=2.17,&lt;3.0.a0']

Your installed version is: 2.33
</code></pre>
<p>My cuda version from nvidia-smi -</p>
<pre><code class="lang-auto">+-----------------------------------------------------------------------------+
| NVIDIA-SMI 460.80       Driver Version: 460.80       CUDA Version: 11.2     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|                               |                      |               MIG M. |
|===============================+======================+======================|
|   0  GeForce GTX 108...  Off  | 00000000:01:00.0 Off |                  N/A |
|  0%   90C    P5    29W / 250W |    131MiB / 11178MiB |      2%      Default |
|                               |                      |                  N/A |
</code></pre>

username: ptrblck
cooked: <p>It seems that at least two PyTorch packages are conflicting as <code>1.8.1</code> and <code>1.4.0</code>. Did you also activate this new environment? If so, which Python version are you using?</p>

username: daddyodevil
cooked: <p>Yes I have activated the environment and the python version is 3.8.10, it is the default version that Conda created.</p>

username: ptrblck
cooked: <p>I’m unable to reproduce the issue, as I can create a new env and install the packages there.<br>
Could you also create a new env without the <code>prefix</code> usage via:</p>
<pre><code class="lang-auto">conda create -n tmp python=3.8
conda activate tmp
conda install pytorch torchvision torchaudio cudatoolkit=11.1 -c pytorch -c nvidia
python -c "import torch; print(torch.__version__)"
</code></pre>