# TotalSegmentator error at first run: "Command ‘pip’, ‘install’, ‘git+https://github.com/wasserth/TotalSegmentator.git’, ‘–no-deps’\]’ returned non-zero exit status"

**URL:** <https://discourse.slicer.org/t/totalsegmentator-error-at-first-run-command-pip-install-git-https-github-com-wasserth-totalsegmentator-git-no-deps-returned-non-zero-exit-status/26715>\
**Category:** Support\
**Tags:** segmentation\
**Created:** [December 13, 2022, 3:44pm UTC](https://discourse.slicer.org/t/totalsegmentator-error-at-first-run-command-pip-install-git-https-github-com-wasserth-totalsegmentator-git-no-deps-returned-non-zero-exit-status/26715 "2022-12-13T15:44:54Z")\
**Posts on this page:** 20\
**Page:** 2

<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:** [January 3, 2023, 6:29am UTC](https://discourse.slicer.org/t/totalsegmentator-error-at-first-run-command-pip-install-git-https-github-com-wasserth-totalsegmentator-git-no-deps-returned-non-zero-exit-status/26715/21 "2023-01-03T06:29:56Z")

</div>

It seems that you have an old driver and CUDA version installed, which may cause incompatibility issues.

Please install the [latest CUDA version that pytorch supports](https://pytorch.org/get-started/locally/) - currently CUDA 11.6 or 11.7 - and then [uninstall and install pytorch](https://github.com/lassoan/SlicerTotalSegmentator/#segmentation-fails-while-predicting).

---

<div class="post-metadata">

**Author:** ![Knoch](https://avatars.discourse-cdn.com/v4/letter/k/4491bb/32.png) [@Knoch](https://discourse.slicer.org/u/Knoch)\
**Post date:** [January 3, 2023, 7:13am UTC](https://discourse.slicer.org/t/totalsegmentator-error-at-first-run-command-pip-install-git-https-github-com-wasserth-totalsegmentator-git-no-deps-returned-non-zero-exit-status/26715/22 "2023-01-03T07:13:56Z")

</div>

Already update the drivers, but still got the error message:

![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/d/9/d9748b9ee276fcc3979a27b23975f60a04a29ac6.png)

the message:

Traceback (most recent call last):  
File “C:\Users\ACER\AppData\Local\NA-MIC\Slicer 5.2.1\bin\Python\slicer\util.py”, line 2961, in tryWithErrorDisplay  
yield  
File “C:/Users/ACER/AppData/Local/NA-MIC/Slicer 5.2.1/NA-MIC/Extensions-31317/TotalSegmentator/lib/Slicer-5.2/qt-scripted-modules/TotalSegmentator.py”, line 258, in onApplyButton  
self.logic.process(self.ui.inputVolumeSelector.currentNode(), self.ui.outputSegmentationSelector.currentNode(),  
File “C:/Users/ACER/AppData/Local/NA-MIC/Slicer 5.2.1/NA-MIC/Extensions-31317/TotalSegmentator/lib/Slicer-5.2/qt-scripted-modules/TotalSegmentator.py”, line 715, in process  
self.logProcessOutput(proc)  
File “C:/Users/ACER/AppData/Local/NA-MIC/Slicer 5.2.1/NA-MIC/Extensions-31317/TotalSegmentator/lib/Slicer-5.2/qt-scripted-modules/TotalSegmentator.py”, line 624, in logProcessOutput  
raise CalledProcessError(retcode, proc.args, output=proc.stdout, stderr=proc.stderr)  
subprocess.CalledProcessError: Command ‘[‘C:/Users/ACER/AppData/Local/NA-MIC/Slicer 5.2.1/bin/…/bin\PythonSlicer.EXE’, ‘C:\Users\ACER\AppData\Local\NA-MIC\Slicer 5.2.1\lib\Python\Scripts\TotalSegmentator’, ‘-i’, ‘C:/Users/ACER/AppData/Local/Temp/Slicer/\_\_SlicerTemp\_\_2023-01-03\_14+12+33.314/total-segmentator-input.nii’, ‘-o’, ‘C:/Users/ACER/AppData/Local/Temp/Slicer/\_\_SlicerTemp\_\_2023-01-03\_14+12+33.314/segmentation’, ‘–ml’, ‘–task’, ‘total’]’ returned non-zero exit status 120.

---

<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:** [January 3, 2023, 7:17am UTC](https://discourse.slicer.org/t/totalsegmentator-error-at-first-run-command-pip-install-git-https-github-com-wasserth-totalsegmentator-git-no-deps-returned-non-zero-exit-status/26715/23 "2023-01-03T07:17:29Z")

</div>

How much memory your GPU has? Do you have issues with all data sets or just some of them?

Probably the best is if you remove Slicer and reinstall it. All the experimentation with installing various pytorch versions may have messed things up.

---

<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:** [January 3, 2023, 8:41am UTC](https://discourse.slicer.org/t/totalsegmentator-error-at-first-run-command-pip-install-git-https-github-com-wasserth-totalsegmentator-git-no-deps-returned-non-zero-exit-status/26715/24 "2023-01-03T08:41:11Z")

</div>

On my borderline laptop, I get a “less than 7 GB” warning for a “total” TotalSegmentator run with the CTChest sample dataset.

If I select “No” (no FAST mode) →

Processing completed in 226.51 seconds

System Settings:

NVIDIA System Information report created on: 01/03/2023 09:17:56  
System name: LAPTOP-xxxxxxxxxx

[Display]  
Operating System: Windows 10 Home, 64-bit  
DirectX version: 12.0  
GPU processor: NVIDIA GeForce GTX 1060  
Driver version: 526.98  
Driver Type: DCH  
Direct3D feature level: 12\_1  
CUDA Cores: 1280  
Core clock: 1404 MHz  
Memory data rate: 8.01 Gbps  
Memory interface: 192-bit  
Memory bandwidth: 192.19 GB/s  
Total available graphics memory: 14278 MB  
Dedicated video memory: 6144 MB GDDR5  
System video memory: 0 MB  
Shared system memory: 8134 MB  
Video BIOS version: 86.06.3A.00.0F  
IRQ: Not used  
Bus: PCI Express x16 Gen3  
Device Id: 10DE 1C20 114E1025  
Part Number: 2914 0030

Could you post your system information? See NVIDIA Control Panel → System Information

---

<div class="post-metadata">

**Author:** ![pixellett](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pixellett/32/17897_2.png) [@pixellett](https://discourse.slicer.org/u/pixellett)\
**Post date:** [January 3, 2023, 9:29am UTC](https://discourse.slicer.org/t/totalsegmentator-error-at-first-run-command-pip-install-git-https-github-com-wasserth-totalsegmentator-git-no-deps-returned-non-zero-exit-status/26715/25 "2023-01-03T09:29:22Z")

</div>

I am having the same issue with “returned non-zero exit status 120”

I have a clean install of Slicer 5.2.1. Am running with 128Gigs RAM and a 3090Ti with 24Gigs.  
PyTorch is 1.13.1+cu117

I have noticed that the file that is saved in the …/fold\_0 folder during processing is only called model\_final\_checkpoint.model - it does not have the .pkl extension as well - not sure if that is the issue?

**TotalSegmentator window:**  
Processing started  
Writing input file to C:/Users/282745H/AppData/Local/Temp/Slicer/\_\_SlicerTemp\_\_2023-01-03\_17+18+42.605/total-segmentator-input.nii  
Creating segmentations with TotalSegmentator AI…  
Total Segmentator arguments: [‘-i’, ‘C:/Users/282745H/AppData/Local/Temp/Slicer/\_\_SlicerTemp\_\_2023-01-03\_17+18+42.605/total-segmentator-input.nii’, ‘-o’, ‘C:/Users/282745H/AppData/Local/Temp/Slicer/\_\_SlicerTemp\_\_2023-01-03\_17+18+42.605/segmentation’, ‘–ml’, ‘–task’, ‘total’, ‘–fast’]  
Traceback (most recent call last):  
File “C:\Users\282745H\AppData\Local\NA-MIC\Slicer 5.2.1\lib\Python\Scripts\TotalSegmentator”, line 201, in   
main()  
File “C:\Users\282745H\AppData\Local\NA-MIC\Slicer 5.2.1\lib\Python\Scripts\TotalSegmentator”, line 179, in main  
seg = nnUNet\_predict\_image(args.input, args.output, task\_id, model=model, folds=folds,  
File “C:\Users\282745H\AppData\Local\NA-MIC\Slicer 5.2.1\lib\Python\Lib\site-packages\totalsegmentator\nnunet.py”, line 232, in nnUNet\_predict\_image  
nnUNet\_predict(tmp\_dir, tmp\_dir, task\_id, model, folds, trainer, tta)  
File “C:\Users\282745H\AppData\Local\NA-MIC\Slicer 5.2.1\lib\Python\Lib\site-packages\totalsegmentator\nnunet.py”, line 106, in nnUNet\_predict  
predict\_from\_folder(model\_folder\_name, dir\_in, dir\_out, folds, save\_npz, num\_threads\_preprocessing,  
File “C:\Users\282745H\AppData\Local\NA-MIC\Slicer 5.2.1\lib\Python\Lib\site-packages\nnunet\inference\predict.py”, line 668, in predict\_from\_folder  
return predict\_cases\_fastest(model, list\_of\_lists[part\_id::num\_parts], output\_files[part\_id::num\_parts], folds,  
File “C:\Users\282745H\AppData\Local\NA-MIC\Slicer 5.2.1\lib\Python\Lib\site-packages\nnunet\inference\predict.py”, line 468, in predict\_cases\_fastest  
trainer, params = load\_model\_and\_checkpoint\_files(model, folds, mixed\_precision=mixed\_precision, checkpoint\_name=checkpoint\_name)  
File “C:\Users\282745H\AppData\Local\NA-MIC\Slicer 5.2.1\lib\Python\Lib\site-packages\nnunet\training\model\_restore.py”, line 140, in load\_model\_and\_checkpoint\_files  
trainer = restore\_model(join(folds[0], “%s.model.pkl” % checkpoint\_name), fp16=mixed\_precision)  
File “C:\Users\282745H\AppData\Local\NA-MIC\Slicer 5.2.1\lib\Python\Lib\site-packages\nnunet\training\model\_restore.py”, line 56, in restore\_model  
info = load\_pickle(pkl\_file)  
File “C:\Users\282745H\AppData\Local\NA-MIC\Slicer 5.2.1\lib\Python\Lib\site-packages\batchgenerators\utilities\file\_and\_folder\_operations.py”, line 49, in load\_pickle  
with open(file, mode) as f:  
**FileNotFoundError: [Errno 2] No such file or directory: ‘C:\Users\282745H\.totalsegmentator\nnunet\results\nnUNet\3d\_fullres\Task256\_TotalSegmentator\_3mm\_1139subj\nnUNetTrainerV2\_ep8000\_nomirror\_\_nnUNetPlansv2.1\fold\_0\model\_final\_checkpoint.model.pkl’**  
**Exception ignored in: \<totalsegmentator.libs.DummyFile object at 0x000002BC5A99A730\>**  
**AttributeError: ‘DummyFile’ object has no attribute ‘flush’**  
**Using ‘fast’ option: resampling to lower resolution (3mm)**  
Resampling…  
Resampled in 0.88s  
Predicting…

**Small popup error window:**  
Traceback (most recent call last):  
File “C:\Users\282745H\AppData\Local\NA-MIC\Slicer 5.2.1\bin\Python\slicer\util.py”, line 2961, in tryWithErrorDisplay  
yield  
File “C:/Users/282745H/AppData/Local/NA-MIC/Slicer 5.2.1/NA-MIC/Extensions-31317/TotalSegmentator/lib/Slicer-5.2/qt-scripted-modules/TotalSegmentator.py”, line 258, in onApplyButton  
self.logic.process(self.ui.inputVolumeSelector.currentNode(), self.ui.outputSegmentationSelector.currentNode(),  
File “C:/Users/282745H/AppData/Local/NA-MIC/Slicer 5.2.1/NA-MIC/Extensions-31317/TotalSegmentator/lib/Slicer-5.2/qt-scripted-modules/TotalSegmentator.py”, line 715, in process  
self.logProcessOutput(proc)  
File “C:/Users/282745H/AppData/Local/NA-MIC/Slicer 5.2.1/NA-MIC/Extensions-31317/TotalSegmentator/lib/Slicer-5.2/qt-scripted-modules/TotalSegmentator.py”, line 624, in logProcessOutput  
raise CalledProcessError(retcode, proc.args, output=proc.stdout, stderr=proc.stderr)  
subprocess.CalledProcessError: Command ‘[‘C:/Users/282745H/AppData/Local/NA-MIC/Slicer 5.2.1/bin/…/bin\PythonSlicer.EXE’, ‘C:\Users\282745H\AppData\Local\NA-MIC\Slicer 5.2.1\lib\Python\Scripts\TotalSegmentator’, ‘-i’, ‘C:/Users/282745H/AppData/Local/Temp/Slicer/\_\_SlicerTemp\_\_2023-01-03\_17+18+42.605/total-segmentator-input.nii’, ‘-o’, ‘C:/Users/282745H/AppData/Local/Temp/Slicer/\_\_SlicerTemp\_\_2023-01-03\_17+18+42.605/segmentation’, ‘–ml’, ‘–task’, ‘total’, ‘–fast’]’ returned non-zero exit status 120.

---

<div class="post-metadata">

**Author:** ![Knoch](https://avatars.discourse-cdn.com/v4/letter/k/4491bb/32.png) [@Knoch](https://discourse.slicer.org/u/Knoch)\
**Post date:** [January 3, 2023, 9:38am UTC](https://discourse.slicer.org/t/totalsegmentator-error-at-first-run-command-pip-install-git-https-github-com-wasserth-totalsegmentator-git-no-deps-returned-non-zero-exit-status/26715/26 "2023-01-03T09:38:12Z")

</div>

Already re-install my slicer, instal totalsegmentator and the pytorch again, but the same result

This is my system information:

NVIDIA System Information report created on: 01/03/2023 16:36:34  
System name: PREDATOR

[Display]  
Operating System: Windows 10 Home Single Language, 64-bit  
DirectX version: 12.0  
GPU processor: NVIDIA GeForce RTX 3070 Laptop GPU  
Driver version: 527.56  
Driver Type: DCH  
Direct3D feature level: 12\_1  
CUDA Cores: 5120  
Resizable BAR Yes  
Max-Q Technologies 3rd Gen  
Dynamic Boost 2.0 Yes  
WhisperMode 2.0 Yes  
Advanced Optimus No  
Maximum Graphics Power 100 W  
Core clock: 1290 MHz  
Memory data rate: 12.00 Gbps  
Memory interface: 256-bit  
Memory bandwidth: 384.06 GB/s  
Total available graphics memory: 16299 MB  
Dedicated video memory: 8192 MB GDDR6  
System video memory: 0 MB  
Shared system memory: 8107 MB  
Video BIOS version: 94.04.2B.40.2B  
IRQ: Not used  
Bus: PCI Express x16 Gen3  
Device Id: 10DE 249D 14421025  
Part Number: 4735 0010

---

<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:** [January 3, 2023, 9:57am UTC](https://discourse.slicer.org/t/totalsegmentator-error-at-first-run-command-pip-install-git-https-github-com-wasserth-totalsegmentator-git-no-deps-returned-non-zero-exit-status/26715/27 "2023-01-03T09:57:46Z")

</div>

Sorry for the errors, hope we can fix them. The two systems indicated above should definitely be capable of doing complete TotalSegmentator GPU runs.

Please understand that the 3D Slicer extension is a wrapper of the TotalSegmentator AI tool.  
Have you tried something simple as running Slicer in Admin mode?

You could also install TotalSegmentator in a local Python installation and run it from the command line, which is what we did before implementing the tool wrapper in 3D Slicer.

---

<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:** [January 3, 2023, 11:44am UTC](https://discourse.slicer.org/t/totalsegmentator-error-at-first-run-command-pip-install-git-https-github-com-wasserth-totalsegmentator-git-no-deps-returned-non-zero-exit-status/26715/28 "2023-01-03T11:44:51Z")

</div>

Could you uninstall PyTorch completely with the PyTorch extension.  
Use the restart option and repeat until you get a uninstall success message.  
Then paste

```auto
slicer.util.pip_install("torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu117")

```

it into the Python Interactor and press return and wait until it is installed.

---

<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:** [January 3, 2023, 3:04pm UTC](https://discourse.slicer.org/t/totalsegmentator-error-at-first-run-command-pip-install-git-https-github-com-wasserth-totalsegmentator-git-no-deps-returned-non-zero-exit-status/26715/29 "2023-01-03T15:04:54Z")

</div>

> [@pixellett](#):
>
> FileNotFoundError: [Errno 2] No such file or directory: ‘C:\Users\282745H.totalsegmentator\nnunet\results\nnUNet\3d\_fullres\Task256\_TotalSegmentator\_3mm\_1139subj\nnUNetTrainerV2\_ep8000\_nomirror\_\_nnUNetPlansv2.1\fold\_0\model\_final\_checkpoint.model.pkl’

This looks like a real error. Maybe the model download have been interrupted. Please remove the entire `.totalsegmentator` folder and retry.

> [@Knoch](#):
>
> NVIDIA GeForce RTX 3070 Laptop GPU

Laptop with Optimus technology (switchable integrated graphics/discrete GPU) are always problematic. As a quick test, disable Optimus (choose to always use the GPU for all software) and see if it fixes the issue. If you still get some error then you can contact me in a private message to set up a call with screen sharing so that I can have a closer look.

---

<div class="post-metadata">

**Author:** ![pixellett](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pixellett/32/17897_2.png) [@pixellett](https://discourse.slicer.org/u/pixellett)\
**Post date:** [January 4, 2023, 2:12am UTC](https://discourse.slicer.org/t/totalsegmentator-error-at-first-run-command-pip-install-git-https-github-com-wasserth-totalsegmentator-git-no-deps-returned-non-zero-exit-status/26715/30 "2023-01-04T02:12:36Z")

</div>

Thank you so much for the response @lassoan! Deleting the .totalsegmentator folder is the only thing I hadn’t thought of, all is now working perfectly. You are an absolute legend!

---

<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:** [January 5, 2023, 12:42pm UTC](https://discourse.slicer.org/t/totalsegmentator-error-at-first-run-command-pip-install-git-https-github-com-wasserth-totalsegmentator-git-no-deps-returned-non-zero-exit-status/26715/31 "2023-01-05T12:42:25Z")

</div>

Experienced the same “status 120” error on a fresh AWS EC2 instance today after installation of PyTorch via the extension and running TotalSegmentator.

It happened upon the first run.  
Restarted Slicer and “Upgraded” once which resolved the error.

![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/0/4/044b283461c46f70b261f71cfc52aacf0dca043f.png)

Is your problem solved by now?

---

<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:** [January 6, 2023, 4:43pm UTC](https://discourse.slicer.org/t/totalsegmentator-error-at-first-run-command-pip-install-git-https-github-com-wasserth-totalsegmentator-git-no-deps-returned-non-zero-exit-status/26715/32 "2023-01-06T16:43:20Z")

</div>

@rbumm This is very useful information. I’ve updated TotalSegmentator extension following [fixes in the Python package](https://github.com/wasserth/TotalSegmentator/issues/32). We don’t need the SimpleITK installation hack and git installation anymore. Could you try if Slicer-5.2.1 installation with latest TotalSegmentator still runs into status 120 on a fresh EC2 instance?

---

<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:** [January 6, 2023, 5:03pm UTC](https://discourse.slicer.org/t/totalsegmentator-error-at-first-run-command-pip-install-git-https-github-com-wasserth-totalsegmentator-git-no-deps-returned-non-zero-exit-status/26715/33 "2023-01-06T17:03:40Z")

</div>

@lassoan Sure. Would I need to fork the extension or just install it from the extension manager?

---

<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:** [January 6, 2023, 5:04pm UTC](https://discourse.slicer.org/t/totalsegmentator-error-at-first-run-command-pip-install-git-https-github-com-wasserth-totalsegmentator-git-no-deps-returned-non-zero-exit-status/26715/34 "2023-01-06T17:04:59Z")

</div>

Just install Slicer-5.2.1 from scratch and install TotalSegmentator extension from the Extensions Manager.

---

<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:** [January 6, 2023, 6:30pm UTC](https://discourse.slicer.org/t/totalsegmentator-error-at-first-run-command-pip-install-git-https-github-com-wasserth-totalsegmentator-git-no-deps-returned-non-zero-exit-status/26715/35 "2023-01-06T18:30:13Z")

</div>

@lassoan Now it works. On the fresh EC2 instance (g5.xlarge), PyTorch installs completely from the extension and recognizes the new NVIDIA A10G drivers.

TotalSegmentator installs upon the first run, but takes a while to complete:  
Processing completed in 558.95 seconds

The second run:  
Processing completed in 110.23 seconds

---

<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:** [January 6, 2023, 6:42pm UTC](https://discourse.slicer.org/t/totalsegmentator-error-at-first-run-command-pip-install-git-https-github-com-wasserth-totalsegmentator-git-no-deps-returned-non-zero-exit-status/26715/36 "2023-01-06T18:42:37Z")

</div>

Awesome! Thanks for testing.

First run takes long time because the model weight files (about 1.6GB) have to be downloaded. If this delay causes a problem (slow, unreliable, etc) then we found have a look at where the files are hosted and if adding mirrors would make sense.

---

<div class="post-metadata">

**Author:** ![Omar\_El-Taji](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/omar_el-taji/32/65837_2.png) [@Omar\_El-Taji](https://discourse.slicer.org/u/Omar_El-Taji)\
**Post date:** [April 30, 2023, 3:17am UTC](https://discourse.slicer.org/t/totalsegmentator-error-at-first-run-command-pip-install-git-https-github-com-wasserth-totalsegmentator-git-no-deps-returned-non-zero-exit-status/26715/37 "2023-04-30T03:17:38Z")

</div>

Hi I am having a similar problem. I have m2 MacBook. I have tried all the above including updating PyTorch/total seg as well as downloading git. I have also changed from GPU to CPU in edit-application setting–\> volume rendering–\>VTK CPU (from GPU). I am using sample data. It works for the MRI head. but when I use on CTAP or CT liver or even my own DICOM CT Chest it brings up error messages.

This is my error message  
Traceback (most recent call last):  
File “/Applications/Slicer.app/Contents/bin/Python/slicer/util.py”, line 2973, in tryWithErrorDisplay  
yield  
File “/Applications/Slicer.app/Contents/Extensions-31734/TotalSegmentator/lib/Slicer-5.3/qt-scripted-modules/TotalSegmentator.py”, line 264, in onApplyButton  
self.logic.process(self.ui.inputVolumeSelector.currentNode(), self.ui.outputSegmentationSelector.currentNode(),  
File “/Applications/Slicer.app/Contents/Extensions-31734/TotalSegmentator/lib/Slicer-5.3/qt-scripted-modules/TotalSegmentator.py”, line 799, in process  
self.logProcessOutput(proc)  
File “/Applications/Slicer.app/Contents/Extensions-31734/TotalSegmentator/lib/Slicer-5.3/qt-scripted-modules/TotalSegmentator.py”, line 692, in logProcessOutput  
raise CalledProcessError(retcode, proc.args, output=proc.stdout, stderr=proc.stderr)  
subprocess.CalledProcessError: Command ‘[’/Applications/Slicer.app/Contents/bin/…/bin/PythonSlicer’, ‘/Applications/Slicer.app/Contents/lib/Python/bin/TotalSegmentator’, ‘-i’, ‘/private/var/folders/9l/6p4fv9qs1gb\_22w9xm8\_fm2r0000gn/T/Slicer-omarel-taji/\_\_SlicerTemp\_\_2023-04-30\_02+17+21.212/total-segmentator-input.nii’, ‘-o’, ‘/private/var/folders/9l/6p4fv9qs1gb\_22w9xm8\_fm2r0000gn/T/Slicer-omarel-taji/\_\_SlicerTemp\_\_2023-04-30\_02+17+21.212/segmentation’, ‘–ml’, ‘–task’, ‘total’, ‘–fast’]’ returned non-zero exit status 120.

Thanks

---

<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:** [May 1, 2023, 1:03pm UTC](https://discourse.slicer.org/t/totalsegmentator-error-at-first-run-command-pip-install-git-https-github-com-wasserth-totalsegmentator-git-no-deps-returned-non-zero-exit-status/26715/38 "2023-05-01T13:03:27Z")

</div>

Please start all over again.

It would be great if you could read the [troubleshooting section](https://github.com/lassoan/SlicerTotalSegmentator#troubleshooting) of the TotalSegmentator extension in the beginning.

- Uninstall 3D Slicer and delete the installation directory.
- Install 3D Slicer stable in a new directory.
- Install the Pytorch extension.
- In the Pytorch extension, select CPU support just for a test.

![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/2/d/2db06282a1196c2ca884a26f647b7cf540ee7bef.png)

- Install Pytorch.
- Restart 3D Slicer.
- Install the Totalsegmentator extension.
- Load the CT Chest dataset
- Run TotalSegmentator (will take longer because of using CPU).

If not working, please post the results of the log and/or complete content of progress window here.  
We will handle GPU support later, probably by someone who has an M2 Macbook at hand. Not sure GPU support works in this case.

---

<div class="post-metadata">

**Author:** ![sain](https://avatars.discourse-cdn.com/v4/letter/s/ccd318/32.png) [@sain](https://discourse.slicer.org/u/sain)\
**Post date:** [May 9, 2023, 9:28am UTC](https://discourse.slicer.org/t/totalsegmentator-error-at-first-run-command-pip-install-git-https-github-com-wasserth-totalsegmentator-git-no-deps-returned-non-zero-exit-status/26715/39 "2023-05-09T09:28:32Z")

</div>

I am having a similar problem too.

I installed pytorch module and totalsegmentator in extensions manager，and installed NVIDIA CUDA11.8 and GIT.  
But there was still some errors when running the program.Need help to solve this，thx！

Here are the error infos。

first try:  
Traceback (most recent call last):  
File “C:\Users\sain\Desktop\3DSilcer\Slicer 5.2.2\bin\Python\slicer\util.py”, line 2967, in tryWithErrorDisplay  
yield  
File “C:/Users/sain/Desktop/3DSilcer/Slicer 5.2.2/NA-MIC/Extensions-31382/TotalSegmentator/lib/Slicer-5.2/qt-scripted-modules/TotalSegmentator.py”, line 255, in onApplyButton  
self.logic.setupPythonRequirements()  
File “C:/Users/sain/Desktop/3DSilcer/Slicer 5.2.2/NA-MIC/Extensions-31382/TotalSegmentator/lib/Slicer-5.2/qt-scripted-modules/TotalSegmentator.py”, line 660, in setupPythonRequirements  
slicer.util.pip\_install(self.totalSegmentatorPythonPackageDownloadUrl)  
File “C:\Users\sain\Desktop\3DSilcer\Slicer 5.2.2\bin\Python\slicer\util.py”, line 3578, in pip\_install  
\_executePythonModule(‘pip’, args)  
File “C:\Users\sain\Desktop\3DSilcer\Slicer 5.2.2\bin\Python\slicer\util.py”, line 3540, in \_executePythonModule  
logProcessOutput(proc)  
File “C:\Users\sain\Desktop\3DSilcer\Slicer 5.2.2\bin\Python\slicer\util.py”, line 3509, in logProcessOutput  
raise CalledProcessError(retcode, proc.args, output=proc.stdout, stderr=proc.stderr)  
subprocess.CalledProcessError: Command '[‘C:/Users/sain/Desktop/3DSilcer/Slicer 5.2.2/bin/…/bin\PythonSlicer.EXE’, ‘-m’, ‘pip’, ‘install’, '[https://github.com/wasserth/TotalSegmentator/archive/b38eb449ad8652a987878a925203cbfa354e9b85.zip’]’](https://github.com/wasserth/TotalSegmentator/archive/b38eb449ad8652a987878a925203cbfa354e9b85.zip'%5D') returned non-zero exit status 1.

second try：  
Traceback (most recent call last):  
File “C:\Users\sain\Desktop\3DSilcer\Slicer 5.2.2\bin\Python\slicer\util.py”, line 2967, in tryWithErrorDisplay  
yield  
File “C:/Users/sain/Desktop/3DSilcer/Slicer 5.2.2/NA-MIC/Extensions-31382/TotalSegmentator/lib/Slicer-5.2/qt-scripted-modules/TotalSegmentator.py”, line 255, in onApplyButton  
self.logic.setupPythonRequirements()  
File “C:/Users/sain/Desktop/3DSilcer/Slicer 5.2.2/NA-MIC/Extensions-31382/TotalSegmentator/lib/Slicer-5.2/qt-scripted-modules/TotalSegmentator.py”, line 660, in setupPythonRequirements  
slicer.util.pip\_install(self.totalSegmentatorPythonPackageDownloadUrl)  
File “C:\Users\sain\Desktop\3DSilcer\Slicer 5.2.2\bin\Python\slicer\util.py”, line 3578, in pip\_install  
\_executePythonModule(‘pip’, args)  
File “C:\Users\sain\Desktop\3DSilcer\Slicer 5.2.2\bin\Python\slicer\util.py”, line 3540, in \_executePythonModule  
logProcessOutput(proc)  
File “C:\Users\sain\Desktop\3DSilcer\Slicer 5.2.2\bin\Python\slicer\util.py”, line 3509, in logProcessOutput  
raise CalledProcessError(retcode, proc.args, output=proc.stdout, stderr=proc.stderr)  
subprocess.CalledProcessError: Command '[‘C:/Users/sain/Desktop/3DSilcer/Slicer 5.2.2/bin/…/bin\PythonSlicer.EXE’, ‘-m’, ‘pip’, ‘install’, '[https://github.com/wasserth/TotalSegmentator/archive/b38eb449ad8652a987878a925203cbfa354e9b85.zip’]’](https://github.com/wasserth/TotalSegmentator/archive/b38eb449ad8652a987878a925203cbfa354e9b85.zip'%5D') returned non-zero exit status 2.

---

<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:** [May 9, 2023, 10:48am UTC](https://discourse.slicer.org/t/totalsegmentator-error-at-first-run-command-pip-install-git-https-github-com-wasserth-totalsegmentator-git-no-deps-returned-non-zero-exit-status/26715/40 "2023-05-09T10:48:17Z")

</div>

Could you try with the latest Slicer Preview Release?

[Previous page](https://discourse.slicer.org/t/totalsegmentator-error-at-first-run-command-pip-install-git-https-github-com-wasserth-totalsegmentator-git-no-deps-returned-non-zero-exit-status/26715.md?page=1)

[Next page](https://discourse.slicer.org/t/totalsegmentator-error-at-first-run-command-pip-install-git-https-github-com-wasserth-totalsegmentator-git-no-deps-returned-non-zero-exit-status/26715.md?page=3)
