Uninstall PyTorch completely to install older version

JustWriteSomething: <p>I have the kernel error in ComyUI that suggests my current PyTorch install (v12.8 on Windows 10) is incompatible with my GeForce GTX 960 (CUDA capability 5.2) and CUDA 12.6.</p>
<p>When I have tried to uninstall PyTorch and install an older version I received an error with folders named ~orch, which suggested the previous install was not entirely removed. I deleted the venv folder and allowed Comfy to recreate everything but I still get the error.</p>
<p>I’d now like to completely remove PyTorch and try starting again - is there a step-by-step guide anywhere to help me make sure it is removed from my system?</p>
<p>Thank you</p>

ptrblck: <aside class="quote no-group" data-username="JustWriteSomething" data-post="1" data-topic="223551">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://discuss.pytorch.org/letter_avatar_proxy/v4/letter/j/90db22/48.png" class="avatar"> JustWriteSomething:</div>
<blockquote>
<p>I’d now like to completely remove PyTorch and try starting again - is there a step-by-step guide anywhere to help me make sure it is removed from my system?</p>
</blockquote>
</aside>
<p>Our currently releases are using <code>pip</code> to install PyTorch as described in our <a href="https://pytorch.org/get-started/locally/">install instructions</a>. To uninstall the PyTorch pip wheel just execute <code>pip uninstall torch -y</code> a few times until no installation in the current environment is found anymore.</p>
<p>If you’ve installed PyTorch via another installer (I don’t know what <code>ComfyUI</code> does under the hood) you might need to check how exactly these tools installed PyTorch.</p>

JustWriteSomething: <p>Thank you. Interestingly when I run that command, the install states that it is removing v2.8_cu<strong>126</strong>.</p>
<p>It now seems to be gone. However, when I started ComfyUI, it stated that it was using v2.8_cu<strong>129</strong></p>
<p><div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/4/b/4bb8f9507b83d049170a0a61d6899561f81d33f9.jpeg" data-download-href="https://discuss.pytorch.org/uploads/default/4bb8f9507b83d049170a0a61d6899561f81d33f9" title="ComfyUI"><img src="https://discuss.pytorch.org/uploads/default/optimized/3X/4/b/4bb8f9507b83d049170a0a61d6899561f81d33f9_2_690x92.jpeg" alt="ComfyUI" data-base62-sha1="aNS784sfk7K0NXedgeTi2fDbQuJ" width="690" height="92" srcset="https://discuss.pytorch.org/uploads/default/optimized/3X/4/b/4bb8f9507b83d049170a0a61d6899561f81d33f9_2_690x92.jpeg, https://discuss.pytorch.org/uploads/default/optimized/3X/4/b/4bb8f9507b83d049170a0a61d6899561f81d33f9_2_1035x138.jpeg 1.5x, https://discuss.pytorch.org/uploads/default/optimized/3X/4/b/4bb8f9507b83d049170a0a61d6899561f81d33f9_2_1380x184.jpeg 2x" data-dominant-color="0B0B0B"><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">ComfyUI</span><span class="informations">1600×215 54.7 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></p>
<p>I wonder if ComfyUI has its own directory and own version of PyTorch hiding somewhere and that is causing the conflict.</p>

ptrblck: <aside class="quote no-group" data-username="JustWriteSomething" data-post="3" data-topic="223551">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://discuss.pytorch.org/letter_avatar_proxy/v4/letter/j/90db22/48.png" class="avatar"> JustWriteSomething:</div>
<blockquote>
<p>I wonder if ComfyUI has its own directory and own version of PyTorch hiding somewhere and that is causing the conflict.</p>
</blockquote>
</aside>
<p>I don’t know but this seems to be the case. To support your older Maxwell GPU you would need to install our PyTorch wheel with CUDA 12.6 since CUDA 12.8 and 12.9 deprecated Maxwell to Volta and 13.0 dropped it.</p>

JustWriteSomething: <aside class="quote no-group" data-username="ptrblck" data-post="4" data-topic="223551">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/ptrblck/48/1823_2.png" class="avatar"> ptrblck:</div>
<blockquote>
<p>PyTorch wheel with CUDA 12.6</p>
</blockquote>
</aside>
<p>OK, thank you. So I see version 2.7.1 appears to have 12.6 version. Is it as simple as executing that line in the cmd window:</p>
<pre><code class="lang-auto">pip install torch==2.7.1 torchvision==0.22.1 torchaudio==2.7.1 --index-url https://download.pytorch.org/whl/cu126
</code></pre>
<p>Or do I need to do something else?</p>

ptrblck: <p>Yes, this command should work based on the instructions to install <a href="https://pytorch.org/get-started/previous-versions/">previous versions</a>. However, also the latest 2.8 release ships with CUDA 12.6 so you would also install it instead.</p>
<p>Note that you would still need to figure out if and where ComfyUI installs another PyTorch build since you already used <code>2.8.0+cu126</code> based on your previous post while ComfyUI used <code>2.8.0+cu129</code> while you did not expect it.</p>

GerryMan: <p>Did you check if any leftover <code>~orch</code> or pytorch folders are still in appdata or your main python folders after deleting the venv??</p>

GerryMan: <p>ComfyUi might be using another python install or venv with pytorch still on it. Did you check that? And if you’re unable to find the pytorch folders in your file manager, you can download cx file explorer from <a href="https://cxexplore.com/" rel="noopener nofollow ugc">cxexplore</a> to find it as this is the file manager that is able to help you keep your files organized.</p>

JustWriteSomething: <p>That’s what I’m trying to ascertain. For now I have removed PyTorch using <a class="mention" href="/u/ptrblck">@ptrblck</a> ‘s suggestion and I still get the ComfyUI warning, so I think there must be another one hiding in the Comfy folder.</p>
<p>Thanks for the suggestion on App Data, I’ll search there to double check</p>

GerryMan: <p>Hi, did you check then?</p>

JustWriteSomething: <p>Hello,</p>
<p>I checked and unfortunately when ComfyUI is initialising it seems to install 12.9 as part of the startup routine, which is clearly overriding my system install of 12.6.</p>
<p>I think I would have to locate the torch within the Comfy venv folder and somehow replace it so that the startup skips the reinstall phase. So far I’ve not found a way to do this.</p>