Error Installing Torch To Windows 11 Pro

JamesCRocks: <p>Hi,</p>
<p>I’m new to Torch so please bear with me <img src="https://discuss.pytorch.org/images/emoji/apple/slight_smile.png?v=12" title=":slight_smile:" class="emoji" alt=":slight_smile:" loading="lazy" width="20" height="20"></p>
<p>I am trying to install and configure Stable Diffusion AI locally on my PC (Windows 11 Pro x64), following a How-To-Geek article (How to Run Stable Diffusion Locally With a GUI on Windows).</p>
<p>Log story short, I ran into problems, primarily with the installation of Torch. So, after several attempts to fix that, I tried installing Torch separately <img src="https://discuss.pytorch.org/images/emoji/apple/slight_smile.png?v=12" title=":slight_smile:" class="emoji" alt=":slight_smile:" loading="lazy" width="20" height="20"></p>
<p>I already have python 6.1 (64bit) installed on my C: drive and used the following command line to install Torch:</p>
<p><code>pip3 install torch==1.8.1+cu111 torchvision==0.9.1+cu111 torchaudio===0.8.1 -f https://download.pytorch.org/whl/torch_stable.html</code></p>
<p>I got all the way through the download and install, then got the error message:</p>
<p><code>ERROR: Package 'torch' requires a different Python: 3.6.1 not in '&gt;=3.6.2'</code></p>
<p>I don’t really know what that means. It appears to be suggesting a different version of python, but a casual search suggests people are getting much the same issue with later versions.</p>
<p>What version of python do I need (if that’s even the issue)?</p>
<p>Any help appreciated.</p>
<p>Thanks</p>
<p>James</p>

ptrblck: <p>Python 3.6’s EOL was in Dec. 2021 and the support was dropped from newer PyTorch releases.<br>
Update your Python version and you should be able to install PyTorch.</p>

JamesCRocks: <p>Hi,</p>
<p>[quote=“ptrblck, post:2, topic:162055, full:true”]Python 3.6’s EOL was in Dec. 2021 and the support was dropped from newer PyTorch releases.<br>
Update your Python version and you should be able to install PyTorch.[/quote]</p>
<p>OK. So I uninstalled Python 3.6x and installed Python 3.10.7 … I checked using “python -V” that the system thinks it is is using that version.</p>
<p>When I now run the command</p>
<p><code>pip3 install torch==1.8.1+cu111 torchvision==0.9.1+cu111 torchaudio===0.8.1 -f https://download.pytorch.org/whl/torch_stable.html</code></p>
<p>I get the error:</p>
<pre><code class="lang-auto">ERROR: Could not find a version that satisfies the requirement torch==1.8.1+cu111 (from versions: 1.11.0, 1.11.0+cpu, 1.11.0+cu113, 1.11.0+cu115, 1.12.0, 1.12.0+cpu, 1.12.0+cu113, 1.12.0+cu116, 1.12.1, 1.12.1+cpu, 1.12.1+cu113, 1.12.1+cu116)
ERROR: No matching distribution found for torch==1.8.1+cu111
</code></pre>
<p>Should I be using a different python version?</p>
<p>Thanks</p>
<p>James</p>

ptrblck: <p>Sorry, I should have warned you about too new Python versions, since you want to use an older PyTorch release.<br>
<code>1.8.1</code> wasn’t built for Python 3.10, so if you really need to install this older PyTorch release, use Python 3.9. However, since <code>1.8.1</code> is also quite old you should have been able to install it for Python 3.6 in the first place via this wheel:<br>
<a href="https://download.pytorch.org/whl/cu111/torch-1.8.1%2Bcu111-cp37-cp37m-win_amd64.whl">1.8.1</a></p>
<p>You could alternatively manually download the desired wheels and <code>pip install</code> them.</p>

JamesCRocks: <p>Hi,</p>
<p>My apologies for the late reply. Reality caught up with me and I’ve only just benn able to get back to this.</p>
<p>Anyway, I had a load of issues but eventually (after uninstalling everything and cleaning it all up) managed to install it.</p>
<p>So, thanks very much <img src="https://discuss.pytorch.org/images/emoji/apple/slight_smile.png?v=12" title=":slight_smile:" class="emoji" alt=":slight_smile:" loading="lazy" width="20" height="20"></p>
<p>James</p>