title: How to add PyTorch LTS version in setup.py?
body: <p>I would like to know how I can include pytorch <strong>LTS</strong> version in my setup.py file for a library.</p>
  <p>From the instructions on <a href="https://pytorch.org/get-started/locally/#start-locally" rel="nofollow noreferrer">https://pytorch.org/get-started/locally/#start-locally</a> , we can see that it needs additional information to find the package.
  Here is the command they suggest :<br />
  <code>pip3 install torch==1.8.2+cu111 torchvision==0.9.2+cu111 torchaudio==0.8.2 -f https://download.pytorch.org/whl/lts/1.8/torch_lts.html</code></p>
  <p>Note the flag at the end <code>-f https://download.pytorch.org/whl/lts/1.8/torch_lts.html</code></p>
  <p>I would like to know, how to include such option in a setup.py.</p>
  <h1>What I have tried</h1>
  <ul>
  <li>Using dependency_links, but it is now deprecated and ignored.</li>
  <li>Using command line flag <code>-f</code> when trying to install my library (<code>pip install -e . -f https://download.pytorch.org/whl/lts/1.8/torch_lts.html </code>). This works but this is not a solution as it would require to enter it every time and would become hard to maintain with more url.</li>
  </ul>
  <h1>Setup.py</h1>
  <p>Here is what my setup.py looks like for now.</p>
  <pre><code>from setuptools import setup
  
  setup(
      name=&quot;my_library&quot;,
      version=&quot;0.1&quot;,
      description=&quot;my library description&quot;,
      packages=[&quot;my_library&quot;],
      python_requires=&quot;&gt;=3.8&quot;,
      install_requires=[
          &quot;torch==1.8.2+cu111@https://download.pytorch.org/whl/lts/1.8/torch_lts.html&quot;,
          &quot;torchvision==0.9.2+cu111@https://download.pytorch.org/whl/lts/1.8/torch_lts.html&quot;,
          &quot;pillow&gt;=8.0.0&quot;,
          &quot;numpy&gt;=1.21.0&quot;,
          &quot;timm==0.4.12&quot;,
      ]
  )
  </code></pre>
  <h1>Steps to reproduce issue</h1>
  <ol>
  <li><code>pip install -e . --no-cache-dir</code></li>
  </ol>
  <h1>Actual Output</h1>
  <pre><code>ERROR: Could not find a version that satisfies the requirement torch==1.8.2+cu111@https://download.pytorch.org/whl/lts/1.8/torch_lts.html (from mdai-core==0.1) (from versions: 0.1.2, 0.1.2.post1, 0.1.2.post2, 1.4.0, 1.5.0, 1.5.1, 1.6.0, 1.7.0, 1.7.1, 1.8.0, 1.8.1, 1.9.0)
  ERROR: No matching distribution found for torch==1.8.2+cu111@https://download.pytorch.org/whl/lts/1.8/torch_lts.html
  </code></pre>
  <h1>Expected Output</h1>
  <p>No error and install process of pytorch lts should begin.</p>
  <p>PS : The <code>==</code> in the version requirements is for testing purposes so that it doesn't download the 1.9 non-LTS. Once we'll be sure it uses the LTS we'll be a ble to use <code>&gt;=</code> as it seems to be the recommended approach for libraries.</p>
  <p>Thanks</p>