TotalSegmentator fails to install PyTorch dependencies – installTorch() got unexpected keyword argument 'torchVisionVersionRequirement'

I’m trying to use the TotalSegmentator extension in 3D Slicer for segmenting an MRI dataset, but I’m running into a consistent error during the dependency installation step.

When clicking “Apply” in the TotalSegmentator module, I get:

PyTorch Python package is required. Installing… (it may take several minutes)

Failed to install Python dependencies:
PyTorchUtilsLogic.installTorch() got an unexpected keyword argument ‘torchVisionVersionRequirement’

nvironment:

  • OS: Windows (also tested on macOS with same error)

  • Slicer version: 5.11.0 (Preview)
    (Also tested on 5.10 stable with same issue

  • Extensions installed:

    • TotalSegmentator (latest)

    • PyTorch (latest via Extensions Manager)

    • nnUNet (latest)

Observations: PyTorch appears installed and visible in Extensions Manager. Error occurs during the automatic dependency installation step triggered by TotalSegmentator. Suggests a mismatch between TotalSegmentator and PyTorchUtils API (unexpected argument)

Is this a known compatibility issue between TotalSegmentator and current PyTorchUtils versions? Is there a recommended Slicer version / extension version combination that avoids this? Is there a way to bypass the internal PyTorch installation step and point to an existing PyTorch install?

Have you tried MONAIAuto3DSeg
It works for version 5.10

Sorry, that’s due to a recent regression that I cause when fixing the macOS installation. I’ve fixed the issue now, please retry tomorrow. You can either use the latest Slicer Stable Release (Slicer-5.10) and update the TotalSegmentator extension; or install the latest Slicer Preview Release (Slicer-5.11) tomorrow.

hallo sir,could I try now?

You can make these changes locally in TotalSegmentator.py‎ file on your computer (you can find the location of the file in the error message in the Python console); or wait for the nightly builds to complete at around 10am EST.

thanks a lot sir!Really appreciate it!

Sorry sir,I cant find any changes when I try to modify your code locally.Did I do something wrong?thank for your reply again!

Please copy here the complete error message. Don’t forget to reload the module or restart Slicer after you make the changes and save the file.

Failed to compute results.

Command ‘[‘D:/software/3D Slicer 5.10.0/bin/../bin\\PythonSlicer.EXE’, ‘D:\\software\\3D Slicer 5.10.0\\lib\\Python\\Scripts\\TotalSegmentator.exe’, ‘-i’, ‘C:/Users/Lenovo/AppData/Local/Temp/Slicer/__SlicerTemp__2026-05-05_11+01+56.029/total-segmentator-input.nii’, ‘-o’, ‘C:/Users/Lenovo/AppData/Local/Temp/Slicer/__SlicerTemp__2026-05-05_11+01+56.029/segmentation’, ‘–device’, ‘gpu’, ‘–task’, ‘vertebrae_body’]’ returned non-zero exit status 1.