# TotalSegmentator error at first run: Command ...Python\\Scripts\\TotalSegmentator... returned non-zero exit status 120

**URL:** <https://discourse.slicer.org/t/totalsegmentator-error-at-first-run-command-python-scripts-totalsegmentator-returned-non-zero-exit-status-120/26755>\
**Category:** Support\
**Tags:** segmentation\
**Created:** [December 15, 2022, 2:41pm UTC](https://discourse.slicer.org/t/totalsegmentator-error-at-first-run-command-python-scripts-totalsegmentator-returned-non-zero-exit-status-120/26755 "2022-12-15T14:41:15Z")\
**Posts on this page:** 10\
**Page:** 2

<div class="post-metadata">

**Author:** ![rbumm](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/rbumm/32/9404_2.png) [@rbumm](https://discourse.slicer.org/u/rbumm)\
**Post date:** [February 21, 2023, 10:28am UTC](https://discourse.slicer.org/t/totalsegmentator-error-at-first-run-command-python-scripts-totalsegmentator-returned-non-zero-exit-status-120/26755/21 "2023-02-21T10:28:20Z")

</div>

Thanks for your comment, @wasserth. I believe the weights are just at the “TOTALSEG\_WEIGHTS\_PATH” independent of 3D Slicer.

In Windows 11 I find the “3d\_fullres” folder only once at

```auto
C:\Users\Rudolf\.totalsegmentator\nnunet\results\nnUNet\3d_fullres\

```

after a successful TotalSegmentator install.

---

<div class="post-metadata">

**Author:** ![zhang\_ming](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/zhang_ming/32/15790_2.png) [@zhang\_ming](https://discourse.slicer.org/u/zhang_ming)\
**Post date:** [February 21, 2023, 1:57pm UTC](https://discourse.slicer.org/t/totalsegmentator-error-at-first-run-command-python-scripts-totalsegmentator-returned-non-zero-exit-status-120/26755/22 "2023-02-21T13:57:59Z")

</div>

thank you very much  
and I have just find the path like you described and I run the source TotalSegment code in linux and the path was ’ :~/.totalsegmentator/nnunet/results/nnUNet/3d\_fullres’.  
and I have just put the weight zip files unzip there. the code run well , and the results were amazing  
thank you.

---

<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:** [March 15, 2023, 3:15pm UTC](https://discourse.slicer.org/t/totalsegmentator-error-at-first-run-command-python-scripts-totalsegmentator-returned-non-zero-exit-status-120/26755/23 "2023-03-15T15:15:46Z")

</div>

5 posts were split to a new topic: [TotalSegmentator error at first run: ‘DummyFile’ object has no attribute ‘flush’](https://discourse.slicer.org/t/totalsegmentator-error-at-first-run-dummyfile-object-has-no-attribute-flush/28399)

---

<div class="post-metadata">

**Author:** ![xiaoli26](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/xiaoli26/32/65621_2.png) [@xiaoli26](https://discourse.slicer.org/u/xiaoli26)\
**Post date:** [April 14, 2023, 3:39pm UTC](https://discourse.slicer.org/t/totalsegmentator-error-at-first-run-command-python-scripts-totalsegmentator-returned-non-zero-exit-status-120/26755/24 "2023-04-14T15:39:35Z")

</div>

That’s right! Thank you very much!

---

<div class="post-metadata">

**Author:** ![17banai99](https://avatars.discourse-cdn.com/v4/letter/1/e8c25b/32.png) [@17banai99](https://discourse.slicer.org/u/17banai99)\
**Post date:** [April 6, 2024, 2:28pm UTC](https://discourse.slicer.org/t/totalsegmentator-error-at-first-run-command-python-scripts-totalsegmentator-returned-non-zero-exit-status-120/26755/25 "2024-04-06T14:28:54Z")

</div>

Hello,  
I want to now if totalsegmenter goes fast with mac book M2, and which modules does it requere?  
Thanks

---

<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:** [April 6, 2024, 2:56pm UTC](https://discourse.slicer.org/t/totalsegmentator-error-at-first-run-command-python-scripts-totalsegmentator-returned-non-zero-exit-status-120/26755/26 "2024-04-06T14:56:31Z")

</div>

AI support in Apple Silicon systems is still lagging behind. Apple MPS acceleration is available now for some pytorch features, which significantly improves speed. However, MPS-accelerated pytorch is not usable for TotalSegmentator yet, because [some features required by nn-UNet are not supported](https://github.com/wasserth/TotalSegmentator/issues/250).

---

<div class="post-metadata">

**Author:** ![17banai99](https://avatars.discourse-cdn.com/v4/letter/1/e8c25b/32.png) [@17banai99](https://discourse.slicer.org/u/17banai99)\
**Post date:** [April 6, 2024, 3:34pm UTC](https://discourse.slicer.org/t/totalsegmentator-error-at-first-run-command-python-scripts-totalsegmentator-returned-non-zero-exit-status-120/26755/27 "2024-04-06T15:34:15Z")

</div>

So you don’t advise me to buy MacOs for 3d slicer?

 ![IMG_2782](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/1/5/15f0329bc2619eeb6dd9df82bb48c29198142bcc.jpeg)  
However i have done this with mac book air M2🤔

---

<div class="post-metadata">

**Author:** ![pieper](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pieper/32/8_2.png) [@pieper](https://discourse.slicer.org/u/pieper)\
**Post date:** [April 6, 2024, 3:39pm UTC](https://discourse.slicer.org/t/totalsegmentator-error-at-first-run-command-python-scripts-totalsegmentator-returned-non-zero-exit-status-120/26755/28 "2024-04-06T15:39:34Z")

</div>

Generally Slicer on mac systems works pretty well most operations, however ML models aren’t as well supported since most of that work requires Nvidia systems for top performance currently. That may change in the future, but that’s the state of things now.

---

<div class="post-metadata">

**Author:** ![Nicolas\_Larragueta](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/nicolas_larragueta/32/66218_2.png) [@Nicolas\_Larragueta](https://discourse.slicer.org/u/Nicolas_Larragueta)\
**Post date:** [July 31, 2024, 2:16pm UTC](https://discourse.slicer.org/t/totalsegmentator-error-at-first-run-command-python-scripts-totalsegmentator-returned-non-zero-exit-status-120/26755/29 "2024-07-31T14:16:50Z")

</div>

I have a similar problem, can you help me? Thank you

Traceback (most recent call last):  
File “”, line 5, in   
File “”, line 148, in   
File “C:/3DSlicer/Slicer 5.6.2/slicer.org/Extensions-32448/TotalSegmentator/lib/Slicer-5.6/qt-scripted-modules/TotalSegmentator.py”, line 971, in process  
self.processVolume(inputFile, inputVolume,  
File “C:/3DSlicer/Slicer 5.6.2/slicer.org/Extensions-32448/TotalSegmentator/lib/Slicer-5.6/qt-scripted-modules/TotalSegmentator.py”, line 1045, in processVolume  
self.logProcessOutput(proc)  
File “C:/3DSlicer/Slicer 5.6.2/slicer.org/Extensions-32448/TotalSegmentator/lib/Slicer-5.6/qt-scripted-modules/TotalSegmentator.py”, line 817, in logProcessOutput  
raise CalledProcessError(retcode, proc.args, output=proc.stdout, stderr=proc.stderr)  
subprocess.CalledProcessError: Command ‘[‘C:/3DSlicer/Slicer 5.6.2/bin/…/bin\PythonSlicer.EXE’, ‘C:\3DSlicer\Slicer 5.6.2\lib\Python\Scripts\TotalSegmentator.exe’, ‘-i’, ‘C:/Users/Familia Larragueta/AppData/Local/Temp/Slicer/\_\_SlicerTemp\_\_2024-07-31\_11+15+21.031/total-segmentator-input.nii’, ‘-o’, ‘C:/Users/Familia Larragueta/AppData/Local/Temp/Slicer/\_\_SlicerTemp\_\_2024-07-31\_11+15+21.031/segmentation’, ‘–ml’, ‘–task’, ‘total’, ‘–fast’, ‘–device’, ‘cpu’]’ returned non-zero exit status 1.

---

<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:** [August 1, 2024, 7:43am UTC](https://discourse.slicer.org/t/totalsegmentator-error-at-first-run-command-python-scripts-totalsegmentator-returned-non-zero-exit-status-120/26755/30 "2024-08-01T07:43:57Z")

</div>

You probably have either ran out of memory (try on a smaller, lower-resolution CT) or there were problems installing required libraries. Please check the application log to get hints on what exactly happened.

[Previous page](https://discourse.slicer.org/t/totalsegmentator-error-at-first-run-command-python-scripts-totalsegmentator-returned-non-zero-exit-status-120/26755.md?page=1)
