# TotalSegmentator install problem - pytorch version?

**URL:** <https://discourse.slicer.org/t/totalsegmentator-install-problem-pytorch-version/46167>\
**Category:** Support\
**Tags:** python\
**Created:** [February 15, 2026, 7:00pm UTC](https://discourse.slicer.org/t/totalsegmentator-install-problem-pytorch-version/46167 "2026-02-15T19:00:14Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mhopeng](https://avatars.discourse-cdn.com/v4/letter/m/fbc32d/32.png) [@mhopeng](https://discourse.slicer.org/u/mhopeng)\
**Post date:** [February 15, 2026, 7:00pm UTC](https://discourse.slicer.org/t/totalsegmentator-install-problem-pytorch-version/46167/1 "2026-02-15T19:00:14Z")

</div>

Hello, I’ve tried to install TotalSegmentator on two macOS systems. When I try to run the sample data set, I get an error that seems to be related to the PyTorch version:

ImportError: cannot import name ‘GradScaler’ from ‘torch’ (/Applications/Slicer.app/Contents/lib/Python/lib/python3.12/site-packages/torch/\__init_\_.py)

A google search suggests that this is a problem with the PyTorch version. The PyTorch installation appears to be managed by a Slicer extension. Is there a version mismatch, or am I on the wrong track here?

---

<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:** [February 15, 2026, 7:30pm UTC](https://discourse.slicer.org/t/totalsegmentator-install-problem-pytorch-version/46167/2 "2026-02-15T19:30:39Z")

</div>

The following about downgrading the nnunetv2 version may help:

> [@Version 5.10.0, error in total segmentator](https://discourse.slicer.org/t/version-5-10-0-error-in-total-segmentator/45200/3):
>
> This appears to be an issue introduced by NNunetv2 developers. This package is a dependency of TotalSegmentator. A possible workaround is to open the NNunet Slicer module which is used for installing versions of the package. Choose to install nnunetv2\<2.6 as it seems like the nnunetv2 2.6.0 version introduced this error that requires torch 2.6.0 and later for the CPU version of GradScaler. Unfortunately, on macOS Slicer factory builds are still x86\_64 builds with no native arm64 build. The lat…

---

<div class="post-metadata">

**Author:** ![mhopeng](https://avatars.discourse-cdn.com/v4/letter/m/fbc32d/32.png) [@mhopeng](https://discourse.slicer.org/u/mhopeng)\
**Post date:** [February 19, 2026, 5:02am UTC](https://discourse.slicer.org/t/totalsegmentator-install-problem-pytorch-version/46167/3 "2026-02-19T05:02:56Z")

</div>

Thanks for that. I think that it is the issue.
