Not able to install PyTorch via pip

mahmoodn: <p>Hi<br>
The following set of commands, according to the official page, to install PyTorch 2.6  in a virtual environment fail.</p>
<pre><code class="lang-auto">[m@login02 llama2-70b]$ python3 -m venv pt26-cu124
[m@login02 llama2-70b]$ source ./pt26-cu124/bin/activate
(pt26-cu124) [m@login02 llama2-70b]$ export CUDA_HOME=/scratch/m/cuda-toolkit/12.4.0
(pt26-cu124) [m@login02 llama2-70b]$ export PATH=$CUDA_HOME/bin:$PATH
(pt26-cu124) [m@login02 llama2-70b]$ export LD_LIBRARY_PATH=$CUDA_HOME/lib64:$LD_LIBRARY_PATH
(pt26-cu124) [m@login02 llama2-70b]$ pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu124
Collecting torch
  Could not find a version that satisfies the requirement torch (from versions: )
No matching distribution found for torch
</code></pre>
<p>Any way to fix that?</p>

ptrblck: <p>Our <a href="https://pytorch.org/get-started/locally/">install instructions</a> for PyTorch 2.6 with CUDA 12.4 on Linux show a simple <code>pip install torch</code> command. I don’t know where you have found the wrong instructions you have posted as no env variable manipulation or index-url is needed for this build.</p>

mahmoodn: <p>I am sorry. I selected Windows. Thank you.</p>

mahmoodn: <p>Sorry for bothering again. According to the figure below, the pip command should install 2.6 version.<br>
<div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/7/6/76cf09e1e9943ad545ab89154cfb7926376da381.png" data-download-href="https://discuss.pytorch.org/uploads/default/76cf09e1e9943ad545ab89154cfb7926376da381" title="image"><img src="https://discuss.pytorch.org/uploads/default/optimized/3X/7/6/76cf09e1e9943ad545ab89154cfb7926376da381_2_689x256.png" alt="image" data-base62-sha1="gX1V1eiZk7lTdE8QuXb3Y9WT38Z" width="689" height="256" srcset="https://discuss.pytorch.org/uploads/default/optimized/3X/7/6/76cf09e1e9943ad545ab89154cfb7926376da381_2_689x256.png, https://discuss.pytorch.org/uploads/default/optimized/3X/7/6/76cf09e1e9943ad545ab89154cfb7926376da381_2_1033x384.png 1.5x, https://discuss.pytorch.org/uploads/default/original/3X/7/6/76cf09e1e9943ad545ab89154cfb7926376da381.png 2x" data-dominant-color="F4D8D3"><div class="meta"><svg class="fa d-icon d-icon-far-image svg-icon" aria-hidden="true"><use href="#far-image"></use></svg><span class="filename">image</span><span class="informations">1206×448 28.2 KB</span><svg class="fa d-icon d-icon-discourse-expand svg-icon" aria-hidden="true"><use href="#discourse-expand"></use></svg></div></a></div><br>
I have created an empty virtual env for that, and ran the following commands.</p>
<pre><code class="lang-auto">[m@login03 ~]$ python3 -m venv pt26-cu124
[m@login03 ~]$ source ./pt26-cu124/bin/activate
(pt26-cu124) [m@login03 ~]$ export CUDA_HOME=/scratch/m/cuda-toolkit/12.4.0
(pt26-cu124) [m@login03 ~]$ export PATH=$CUDA_HOME/bin:$PATH
(pt26-cu124) [m@login03 ~]$ export LD_LIBRARY_PATH=$CUDA_HOME/lib64:$LD_LIBRARY_PATH
(pt26-cu124) [m@login03 ~]$ pip3 install torch torchvision torchaudio
Collecting torch
  Using cached torch-1.10.2-cp36-cp36m-manylinux1_x86_64.whl (881.9 MB)
Collecting torchvision
  Using cached torchvision-0.11.2-cp36-cp36m-manylinux1_x86_64.whl (23.3 MB)
Collecting torchaudio
  Using cached torchaudio-0.10.1-cp36-cp36m-manylinux1_x86_64.whl (2.9 MB)
Collecting dataclasses
  Using cached dataclasses-0.8-py3-none-any.whl (19 kB)
Collecting typing-extensions
  Using cached typing_extensions-4.1.1-py3-none-any.whl (26 kB)
Collecting torch
  Downloading torch-1.10.1-cp36-cp36m-manylinux1_x86_64.whl (881.9 MB)
     |████████████████████████████████| 881.9 MB 17 kB/s
Collecting pillow!=8.3.0,&gt;=5.3.0
  Downloading Pillow-8.4.0-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.1 MB)
     |████████████████████████████████| 3.1 MB 136.6 MB/s
Collecting numpy
  Downloading numpy-1.19.5-cp36-cp36m-manylinux2010_x86_64.whl (14.8 MB)
     |████████████████████████████████| 14.8 MB 133.5 MB/s
Installing collected packages: typing-extensions, dataclasses, torch, pillow, numpy, torchvision, torchaudio
Successfully installed dataclasses-0.8 numpy-1.19.5 pillow-8.4.0 torch-1.10.1 torchaudio-0.10.1 torchvision-0.11.2 typing-extensions-4.1.1
(pt26-cu124) [m@login03 ~]$ pip3 list
Package           Version
----------------- -------
dataclasses       0.8
numpy             1.19.5
Pillow            8.4.0
pip               21.3.1
torch             1.10.1
torchaudio        0.10.1
torchvision       0.11.2
typing_extensions 4.1.1
</code></pre>
<p>As you can see <code>torch             1.10.1</code> has been installed.<br>
Would you please clarify what to do?</p>

ptrblck: <p>Python 3.6 is not supported anymore as our current binaries require Python &gt;= 3.9.<br>
From the install instructions:</p>
<blockquote>
<p><strong>NOTE:</strong> Latest PyTorch requires Python 3.9 or later.</p>
</blockquote>