Failed to get TotalSegmentator package version on macOS

FYI - on a Mac, when I push the button to get package version information, I am getting this error:

Traceback:

Traceback (most recent call last):
  File "/Applications/Slicer 2.app/Contents/bin/Python/slicer/util.py", line 3146, in tryWithErrorDisplay
    yield
  File "/Applications/Slicer 2.app/Contents/Extensions-32251/TotalSegmentator/lib/Slicer-5.5/qt-scripted-modules/TotalSegmentator.py", line 300, in onPackageInfoUpdate
    self.ui.packageInfoTextBrowser.plainText = self.logic.installedTotalSegmentatorPythonPackageInfo().rstrip()
  File "/Applications/Slicer 2.app/Contents/Extensions-32251/TotalSegmentator/lib/Slicer-5.5/qt-scripted-modules/TotalSegmentator.py", line 564, in installedTotalSegmentatorPythonPackageInfo
    versionInfo = subprocess.check_output([shutil.which('PythonSlicer'), "-m", "pip", "show", "TotalSegmentator"]).decode()
  File "/Applications/Slicer 2.app/Contents/lib/Python/lib/python3.9/subprocess.py", line 424, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
  File "/Applications/Slicer 2.app/Contents/lib/Python/lib/python3.9/subprocess.py", line 528, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['/Applications/Slicer 2.app/Contents/bin/../bin/PythonSlicer', '-m', 'pip', 'show', 'TotalSegmentator']' returned non-zero exit status 1.

Have you already installed TotalSegmentator?

What do you see if you start a command terminal and run this?

/Applications/Slicer 2.app/Contents/bin/../bin/PythonSlicer -m pip show TotalSegmentator

I installed the extension, and didn’t think I need to install something else. I did not realize that TotalSegmentator is not installed until I try to “Apply”. I guess it might be good to disable buttons that are not applicable, but since no one else raised this other than me, it is definitely not a priority.

1 Like

Agreed. We should display a more meaningful message. I’ve added an issue to track this:

1 Like

One should either load a volume and press “Apply” (which should install TotalSegmentator if not already there) or “Force reinstall” (under “Advanced”).