# Error while installing Extension Pytorch utils 

**URL:** <https://discourse.slicer.org/t/error-while-installing-extension-pytorch-utils/33261>\
**Category:** Support\
**Tags:** segmentation, python, pytorch\
**Created:** [December 6, 2023, 6:00pm UTC](https://discourse.slicer.org/t/error-while-installing-extension-pytorch-utils/33261 "2023-12-06T18:00:28Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Novak\_xu](https://avatars.discourse-cdn.com/v4/letter/n/c5a1d2/32.png) [@Novak\_xu](https://discourse.slicer.org/u/Novak_xu)\
**Post date:** [December 6, 2023, 6:00pm UTC](https://discourse.slicer.org/t/error-while-installing-extension-pytorch-utils/33261/1 "2023-12-06T18:00:28Z")

</div>

Hello, dear repositories  
I am having trouble installing Pytorch utils in slicer 5.6.0. When I click the botton “install PyTorch”, it says pytorch will be installed using light-the-torch. After few minutes, I get the error: `ModuleNotFoundError: No module named 'torch'`.

**Detailed error:**

```auto
Traceback (most recent call last):
  File "C:\Users\jaxni\AppData\Local\slicer.org\Slicer 5.6.0\bin\Python\slicer\util.py", line 3252, in tryWithErrorDisplay
    yield
  File "C:/Users/jaxni/AppData/Local/slicer.org/Slicer 5.6.0/slicer.org/Extensions-32390/PyTorch/lib/Slicer-5.6/qt-scripted-modules/PyTorchUtils.py", line 78, in onInstallTorch
    torch = self.logic.installTorch(askConfirmation, None if automaticBackend else backend, torchVersionRequirement, torchvisionVersionRequirement)
  File "C:/Users/jaxni/AppData/Local/slicer.org/Slicer 5.6.0/slicer.org/Extensions-32390/PyTorch/lib/Slicer-5.6/qt-scripted-modules/PyTorchUtils.py", line 225, in installTorch
    import torch
ModuleNotFoundError: No module named 'torch'

```

To use the TotalSegamentor, I need to install this Pytorch utils.  
**Meanwhile, I tried to uninstall pytorch and uninstall the extension Pytorch utils, then install. The Error happened again. I also uninstall the 5.6.0 Slicer, did not use.**

**I also went the Pytorch utils Github Home Page, use the python Console to install (Follow the guide in the READE.md). Similar Error happened.**

```auto
Traceback (most recent call last):
  File "<string>", line 2, in <module>
  File "C:/Users/jaxni/AppData/Local/slicer.org/Slicer 5.6.0/slicer.org/Extensions-32390/PyTorch/lib/Slicer-5.6/qt-scripted-modules/PyTorchUtils.py", line 154, in torch
    self._torch = self.importTorch()
  File "C:/Users/jaxni/AppData/Local/slicer.org/Slicer 5.6.0/slicer.org/Extensions-32390/PyTorch/lib/Slicer-5.6/qt-scripted-modules/PyTorchUtils.py", line 186, in importTorch
    torch = self.installTorch()
  File "C:/Users/jaxni/AppData/Local/slicer.org/Slicer 5.6.0/slicer.org/Extensions-32390/PyTorch/lib/Slicer-5.6/qt-scripted-modules/PyTorchUtils.py", line 225, in installTorch
    import torch
ModuleNotFoundError: No module named 'torch'

```

Please let me know “Am I doing the wrong flow path?” and How I solve this Error?

Thank you for your time, I truly appreciate your support.

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [December 6, 2023, 6:02pm UTC](https://discourse.slicer.org/t/error-while-installing-extension-pytorch-utils/33261/2 "2023-12-06T18:02:42Z")

</div>

PyTorch may need about 20GB free disk space during installation. I would recommend to delete your `C:/Users/jaxni/AppData/Local/slicer.org/Slicer 5.6.0` folder, reinstall Slicer from scratch, and make sure you have 20GB+ disk space and solid network connection.
