# Error downloading pytorch: "AttributeError: module ‘light\_the\_torch’ has no attribute ‘find\_links’"

**URL:** <https://discourse.slicer.org/t/error-downloading-pytorch-attributeerror-module-light-the-torch-has-no-attribute-find-links/23928>\
**Category:** Support\
**Created:** [June 18, 2022, 3:01pm UTC](https://discourse.slicer.org/t/error-downloading-pytorch-attributeerror-module-light-the-torch-has-no-attribute-find-links/23928 "2022-06-18T15:01:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![hourglassnam](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/hourglassnam/32/11796_2.png) [@hourglassnam](https://discourse.slicer.org/u/hourglassnam)\
**Post date:** [June 18, 2022, 3:01pm UTC](https://discourse.slicer.org/t/error-downloading-pytorch-attributeerror-module-light-the-torch-has-no-attribute-find-links/23928/1 "2022-06-18T15:01:56Z")

</div>

Hello,  
I want to download PyTorch to use TorchIO for the data augmentation process.  
I installed TorchIO and PyTorch Utils, but when I tried to install PyTorch using PyTorch Utils it gave me an attribution error.  
I tried the installation on 3D slicer version 4.13.0 and 5.1.0 using my window10 computer, but nothing worked.  
I tested installation on a different computer, which worked fine and confused me even more.  
I got the following message.  
Could you please give me some advice?  
Thank you very much.

> Importing torch…  
> Querying light-the-torch for torch wheel…  
> Requirement already satisfied: light-the-torch in c:\users\njy95\appdata\local\na-mic\slicer 5.1.0-2022-06-14\lib\python\lib\site-packages (0.4.0)  
> Requirement already satisfied: pip!=22.0,!=22.0.1,!=22.0.2,\<22.2,\>=22.0 in c:\users\njy95\appdata\local\na-mic\slicer 5.1.0-2022-06-14\lib\python\lib\site-packages (from light-the-torch) (22.0.3)  
> WARNING: You are using pip version 22.0.3; however, version 22.1.2 is available.  
> You should consider upgrading via the ‘C:\Users\njy95\AppData\Local\NA-MIC\Slicer 5.1.0-2022-06-14\bin\python-real.exe -m pip install --upgrade pip’ command.  
> Traceback (most recent call last):  
> File “C:/Users/njy95/AppData/Local/NA-MIC/Slicer 5.1.0-2022-06-14/NA-MIC/Extensions-31027/PyTorch/lib/Slicer-5.1/qt-scripted-modules/PyTorchUtils.py”, line 40, in onInstallTorch  
> torch = PyTorchUtilsLogic().torch  
> File “C:/Users/njy95/AppData/Local/NA-MIC/Slicer 5.1.0-2022-06-14/NA-MIC/Extensions-31027/PyTorch/lib/Slicer-5.1/qt-scripted-modules/PyTorchUtils.py”, line 55, in torch  
> self.\_torch = self.importTorch()  
> File “C:/Users/njy95/AppData/Local/NA-MIC/Slicer 5.1.0-2022-06-14/NA-MIC/Extensions-31027/PyTorch/lib/Slicer-5.1/qt-scripted-modules/PyTorchUtils.py”, line 80, in importTorch  
> torch = self.installTorch()  
> File “C:/Users/njy95/AppData/Local/NA-MIC/Slicer 5.1.0-2022-06-14/NA-MIC/Extensions-31027/PyTorch/lib/Slicer-5.1/qt-scripted-modules/PyTorchUtils.py”, line 99, in installTorch  
> slicer.util.pip\_install(self.wheelURL)  
> File “C:/Users/njy95/AppData/Local/NA-MIC/Slicer 5.1.0-2022-06-14/NA-MIC/Extensions-31027/PyTorch/lib/Slicer-5.1/qt-scripted-modules/PyTorchUtils.py”, line 63, in wheelURL  
> self.\_wheel = self.getTorchUrl()  
> File “C:/Users/njy95/AppData/Local/NA-MIC/Slicer 5.1.0-2022-06-14/NA-MIC/Extensions-31027/PyTorch/lib/Slicer-5.1/qt-scripted-modules/PyTorchUtils.py”, line 114, in getTorchUrl  
> wheelUrl = ltt.find\_links([‘torch’])[0]  
> AttributeError: module ‘light\_the\_torch’ has no attribute ‘find\_links’

---

<div class="post-metadata">

**Author:** ![jamesobutler](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jamesobutler/32/7511_2.png) [@jamesobutler](https://discourse.slicer.org/u/jamesobutler)\
**Post date:** [June 18, 2022, 4:35pm UTC](https://discourse.slicer.org/t/error-downloading-pytorch-attributeerror-module-light-the-torch-has-no-attribute-find-links/23928/2 "2022-06-18T16:35:37Z")

</div>

@Fernando recently pushed [Add upper bound for light-the-torch requirement · fepegar/SlicerPyTorch@b1f33d6 · GitHub](https://github.com/fepegar/SlicerPyTorch/commit/b1f33d6527509a607576e544cf225a67bcabe437) to address this issue by using a 2020 version of `pip` instead of the newer 2022 version of `pip` included by default in Slicer. You will be able to update the PyTorch Slicer extension tomorrow to get this latest versions or you can directly install PyTorch with the method in the linked commit.

---

<div class="post-metadata">

**Author:** ![hourglassnam](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/hourglassnam/32/11796_2.png) [@hourglassnam](https://discourse.slicer.org/u/hourglassnam)\
**Post date:** [June 18, 2022, 5:05pm UTC](https://discourse.slicer.org/t/error-downloading-pytorch-attributeerror-module-light-the-torch-has-no-attribute-find-links/23928/3 "2022-06-18T17:05:49Z")

</div>

Thank you so much for your help!  
I was able to install pytorch with the link you provided!! 🙂
