# Total Segmentor Lung Basic BUG report on Version 5.2.2 while working perfectly on 5.2.1

**URL:** <https://discourse.slicer.org/t/total-segmentor-lung-basic-bug-report-on-version-5-2-2-while-working-perfectly-on-5-2-1/28238>\
**Category:** Support\
**Created:** [March 8, 2023, 8:04pm UTC](https://discourse.slicer.org/t/total-segmentor-lung-basic-bug-report-on-version-5-2-2-while-working-perfectly-on-5-2-1/28238 "2023-03-08T20:04:46Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Khaldoun](https://avatars.discourse-cdn.com/v4/letter/k/3ab097/32.png) [@Khaldoun](https://discourse.slicer.org/u/Khaldoun)\
**Post date:** [March 8, 2023, 8:04pm UTC](https://discourse.slicer.org/t/total-segmentor-lung-basic-bug-report-on-version-5-2-2-while-working-perfectly-on-5-2-1/28238/1 "2023-03-08T20:04:46Z")

</div>

Operating system:: Windows 10 Professionnel  
Intel(R) Core™ i5-10505 CPU @ 3.20GHz 3.19 GHz  
16Go RAM  
Slicer version:5.2.2  
Expected behavior:Should be working as well as on version 5.2.1 installed on the same computer using the fast method as there is no CUDA and no GPU intalled  
Actual behavior:: Bug report with 5.2.2 giving this followinf message:  
Failed to compute results: Command ‘[‘C:/Users/g-tnn5319433pc/AppData/Local/NA-MIC/Slicer 5.2.2/bin/…/bin\PythonSlicer.EXE’, ‘C:\Users\g-tnn5319433pc\AppData\Local\NA-MIC\Slicer 5.2.2\lib\Python\Scripts\TotalSegmentator’, ‘-i’, ‘C:/Users/g-tnn5319433pc/AppData/Local/Temp/Slicer/\_\_SlicerTemp\_\_2023-03-08\_20+56+50.090/total-segmentator-input.nii’, ‘-o’, ‘C:/Users/g-tnn5319433pc/AppData/Local/Temp/Slicer/\_\_SlicerTemp\_\_2023-03-08\_20+56+50.090/segmentation’, ‘–ml’, ‘–task’, ‘total’]’ returned non-zero exit status 2.

thank you very much for your kind help  
Khaldoun

---

<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:** [March 8, 2023, 8:57pm UTC](https://discourse.slicer.org/t/total-segmentor-lung-basic-bug-report-on-version-5-2-2-while-working-perfectly-on-5-2-1/28238/2 "2023-03-08T20:57:46Z")

</div>

You must install SlicerPytotch first and install Pytorch.  
Then Restart.  
The Use TotalSegmentator extension with itself installs TotalsSegmentator and sometimes finish with such an error message.  
Restart Slicer, and run TS a second time, that usually fixes it.

---

<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:** [March 8, 2023, 11:42pm UTC](https://discourse.slicer.org/t/total-segmentor-lung-basic-bug-report-on-version-5-2-2-while-working-perfectly-on-5-2-1/28238/3 "2023-03-08T23:42:54Z")

</div>

@rbumm When you install the Slicer TotalSegmentor extension, doesn’t it automatically install the Slicer PyTorch extension dependency?

What situations require the user to manually do the process to install PyTorch?

---

<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:** [March 9, 2023, 6:59am UTC](https://discourse.slicer.org/t/total-segmentor-lung-basic-bug-report-on-version-5-2-2-while-working-perfectly-on-5-2-1/28238/4 "2023-03-09T06:59:03Z")

</div>

You are right, this step is done automatically.

If I just install a TS extension in a fresh 3D Slicer 5.2.2, load a dataset and press “Apply” I still get

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

upon the first try.

Any second run or a run after a 3D Slicer restart will succeed.

---

<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:** [March 13, 2023, 9:33pm UTC](https://discourse.slicer.org/t/total-segmentor-lung-basic-bug-report-on-version-5-2-2-while-working-perfectly-on-5-2-1/28238/5 "2023-03-13T21:33:39Z")

</div>

I am observing an error with the TotalSegmentor (like what is shown in the above image) install due to SlicerTotalSegmentor pointing to an older TotalSegmentor version.

A TotalSegmentor dependency incorrectly specified to install `sklearn` from PyPI instead of `scikit-learn`, and TotalSegmentor [updated](https://github.com/wasserth/TotalSegmentator/blob/b38eb449ad8652a987878a925203cbfa354e9b85/CHANGELOG.md) the dependency with a fix.

> <https://github.com/jamesobutler/SlicerTotalSegmentator/commit/d9b4f6e7a2eae05d099836aa8d314a59df066262>
>
> Until now, there was an option to install latest TotalSegmentator Python package… from GitHub.
> However, since the download URL was always the same, pip always used the same existing package in the cache (did not retrieve the latest content of the URL).
> There were also issues with options and behavior changing significantly between TotalSegmentator Python package versions, so updating the package separately from the Slicer module appeared to be risky.
> 
> Therefore, behavior of the module is now changed so that the required TotalSegmentator Python package version (defined by download URL) is specified in the module logic constructor. When segmentation is started then the package version is checked and the package is updated if needed.
> 
> An option for forced reinstallation was kept for troubleshooting and restoration of corrupted installations.

@rbumm @lassoan Is there a specific need to continue using TotalSegmentor as of [ecf84f9](https://github.com/wasserth/TotalSegmentator/commit/ecf84f9e59b84dddb447e2b13542f58c29ee4c6a)? Would it be possible to upgrade this to the `v1.5.3` tag which appears to contain the `sklearn` fix?

---

<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 13, 2023, 9:57pm UTC](https://discourse.slicer.org/t/total-segmentor-lung-basic-bug-report-on-version-5-2-2-while-working-perfectly-on-5-2-1/28238/6 "2023-03-13T21:57:55Z")

</div>

The current version already contains the sklearn fix (that allowed thousands of users successfully using TotalSegmentator). That said, if you tested this new hash and everything seems to work then there is no problem with updating the git hash. Please submit a pull request! Thank you.

I don’t trust the git tag, as it can be moved to a different version and pip will not notice it. So, please use a git hash (you can add the git label as a comment).

---

<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:** [March 13, 2023, 10:51pm UTC](https://discourse.slicer.org/t/total-segmentor-lung-basic-bug-report-on-version-5-2-2-while-working-perfectly-on-5-2-1/28238/7 "2023-03-13T22:51:54Z")

</div>

> [@lassoan](#):
>
> The current version already contains the sklearn fix (that allowed thousands of users successfully using TotalSegmentator).

> <https://github.com/lassoan/SlicerTotalSegmentator/blob/fe5c538c8afee20f822c7a3e3075ff90fe9b1893/TotalSegmentator/TotalSegmentator.py#L301>

^This hash of TotalSegmentor produced an exit error code 1 associated with trying to install the sklearn from PyPI instead of scikit-learn. I did not previously have TotalSegmentor installed in Slicer 5.2.2.

---

<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:** [March 13, 2023, 11:55pm UTC](https://discourse.slicer.org/t/total-segmentor-lung-basic-bug-report-on-version-5-2-2-while-working-perfectly-on-5-2-1/28238/8 "2023-03-13T23:55:34Z")

</div>

With the currently used TotalSegmentor at [ecf84f9](https://github.com/wasserth/TotalSegmentator/commit/ecf84f9e59b84dddb447e2b13542f58c29ee4c6a) it specifies a hard version requirement of a dependency that then specifies `sklearn` instead of `scikit-learn`. This dependency at nnunet-customized==1.2 includes the fix, but pip —upgrade is not going to make that upgrade since a specific version of this dependency is stated as being required. Maybe this exit code for `sklearn` doesn’t stop TotalSegmentor from working, but does show as an exit code on first running TotalSegmentor when it gets installed.

> <https://github.com/wasserth/TotalSegmentator/blob/ecf84f9e59b84dddb447e2b13542f58c29ee4c6a/setup.py#L27>

Xref [Update nnunet-customized to use scikit-learn instead of sklearn · Issue #72 · wasserth/TotalSegmentator · GitHub](https://github.com/wasserth/TotalSegmentator/issues/72)

---

<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 14, 2023, 2:57pm UTC](https://discourse.slicer.org/t/total-segmentor-lung-basic-bug-report-on-version-5-2-2-while-working-perfectly-on-5-2-1/28238/9 "2023-03-14T14:57:29Z")

</div>

Thanks for the investigation. Yes, probably scikit-learn is actually not needed (similarly as matplotlib and other dependencies are not used either).

@rbumm Created a PR to update to TotalSegmentator Python package and it has been merged.

---

<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:** [March 14, 2023, 4:52pm UTC](https://discourse.slicer.org/t/total-segmentor-lung-basic-bug-report-on-version-5-2-2-while-working-perfectly-on-5-2-1/28238/10 "2023-03-14T16:52:10Z")

</div>

> [@rbumm](#):
>
> If I just install a TS extension in a fresh 3D Slicer 5.2.2, load a dataset and press “Apply” I still get
> 
> ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/3/9/39e0f1c01fa94130c5a5cd96f7c014d1cc075842.png)
> 
> upon the first try.
> 
> Any second run or a run after a 3D Slicer restart will succeed.

I’ve written up the following issue report about errors installing TotalSegmentor python dependencies that results in TotalSegmentor not running the first time. Upon restarting Slicer, it will detect that the TotalSegmentor python package is present and will proceed normally.

> <https://github.com/lassoan/SlicerTotalSegmentator/issues/17>
>
> I'm currently using Slicer 5.2.2, have SlicerPyTorch installed and pointing to S…licerTotalSegmentor as of https://github.com/lassoan/SlicerTotalSegmentator/commit/493fa5bcbb75267e21ec086f95d0eb01ec1562a5.
> 
> I start Slicer fresh, and when I go into TotalSegmentor and press apply, it appropriate warns that PyTorch needs to be downloaded and installed and then it installs the TotalSegmentor package. However I observe that the install process uninstall \`scipy\` 1.9.2 that is included as part of Slicer 5.2.2 and it installs \`scipy\` 1.9.1. This produces an exit code that results in TotalSegmentor not running. Is it expected for the uninstall/install of \`scipy\` to be successful in Slicer? If I close Slicer, reopen and then press "Apply" in TotalSegmentor then it is successful.
> 
> Is access denied because the \`scipy\` package is in-use as it has been \[imported in Slicer on startup\](https://github.com/Slicer/Slicer/blob/fb46bd16846dc7c7a69c398aef0fc3baf533905e/Base/Python/slicer/\_\_init\_\_.py#L68-L69)? 
> \`\`\`
> ERROR: Could not install packages due to an OSError: \[WinError 5\] Access is denied: 'C:\\\\Users\\\\butlej30383\\\\AppData\\\\Local\\\\NA-MIC\\\\Slicer 5.2.2\\\\lib\\\\Python\\\\Lib\\\\site-packages\\\\~cipy\\\\\_lib\\\\\_ccallback\_c.cp39-win\_amd64.pyd'
> Consider using the \`--user\` option or check the permissions.
> \`\`\`
> 
> !\[image\](https://user-images.githubusercontent.com/15837524/225063222-ddf680f7-0caf-4d1e-bf2d-2e652e463fc6.png)
> 
> Additional FYI: The latest \`torch 2.0.0\` was downloaded and installed here.
> \<details\>
> \<summary\>See full pip output here\</summary\>
> Python 3.9.10 (main, Feb 22 2023, 01:07:37) \[MSC v.1930 64 bit (AMD64)\] on win32
> \>\>\> 
> Collecting light-the-torch\>=0.5
> Downloading light\_the\_torch-0.7.1-py3-none-any.whl (14 kB)
> Requirement already satisfied: pip\<23.1,\>=22.3 in c:\\users\\butlej30383\\appdata\\local\\na-mic\\slicer 5.2.2\\lib\\python\\lib\\site-packages (from light-the-torch\>=0.5) (23.0)
> Installing collected packages: light-the-torch
> WARNING: The script ltt.exe is installed in 'C:\\Users\\butlej30383\\AppData\\Local\\NA-MIC\\Slicer 5.2.2\\lib\\Python\\Scripts' which is not on PATH.
> Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
> Successfully installed light-the-torch-0.7.1
> 
> \[notice\] A new release of pip is available: 23.0 -\> 23.0.1
> \[notice\] To update, run: python-real.exe -m pip install --upgrade pip
> Collecting torch
> Downloading https://download.pytorch.org/whl/cu118/torch-2.0.0%2Bcu118-cp39-cp39-win\_amd64.whl (2611.4 MB)
> ---------------------------------------- 2.6/2.6 GB 1.7 MB/s eta 0:00:00
> Collecting jinja2
> Downloading Jinja2-3.1.2-py3-none-any.whl (133 kB)
> -------------------------------------- 133.1/133.1 kB 1.6 MB/s eta 0:00:00
> Collecting typing-extensions
> Downloading typing\_extensions-4.5.0-py3-none-any.whl (27 kB)
> Collecting filelock
> Downloading filelock-3.9.1-py3-none-any.whl (9.7 kB)
> Collecting networkx
> Downloading networkx-3.0-py3-none-any.whl (2.0 MB)
> ---------------------------------------- 2.0/2.0 MB 10.0 MB/s eta 0:00:00
> Collecting sympy
> Downloading sympy-1.11.1-py3-none-any.whl (6.5 MB)
> ---------------------------------------- 6.5/6.5 MB 29.5 MB/s eta 0:00:00
> Collecting MarkupSafe\>=2.0
> Downloading MarkupSafe-2.1.2-cp39-cp39-win\_amd64.whl (16 kB)
> Collecting mpmath\>=0.19
> Downloading mpmath-1.3.0-py3-none-any.whl (536 kB)
> ------------------------------------- 536.2/536.2 kB 32.9 MB/s eta 0:00:00
> Installing collected packages: mpmath, typing-extensions, sympy, networkx, MarkupSafe, filelock, jinja2, torch
> WARNING: The script isympy.exe is installed in 'C:\\Users\\butlej30383\\AppData\\Local\\NA-MIC\\Slicer 5.2.2\\lib\\Python\\Scripts' which is not on PATH.
> Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
> WARNING: The scripts convert-caffe2-to-onnx.exe, convert-onnx-to-caffe2.exe and torchrun.exe are installed in 'C:\\Users\\butlej30383\\AppData\\Local\\NA-MIC\\Slicer 5.2.2\\lib\\Python\\Scripts' which is not on PATH.
> Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
> Successfully installed MarkupSafe-2.1.2 filelock-3.9.1 jinja2-3.1.2 mpmath-1.3.0 networkx-3.0 sympy-1.11.1 torch-2.0.0+cu118 typing-extensions-4.5.0
> 
> \[notice\] A new release of pip is available: 23.0 -\> 23.0.1
> \[notice\] To update, run: python-real.exe -m pip install --upgrade pip
> Collecting matplotlib
> Downloading matplotlib-3.7.1-cp39-cp39-win\_amd64.whl (7.6 MB)
> ---------------------------------------- 7.6/7.6 MB 18.8 MB/s eta 0:00:00
> Collecting python-dateutil\>=2.7
> Downloading python\_dateutil-2.8.2-py2.py3-none-any.whl (247 kB)
> -------------------------------------- 247.7/247.7 kB 7.7 MB/s eta 0:00:00
> Collecting kiwisolver\>=1.0.1
> Downloading kiwisolver-1.4.4-cp39-cp39-win\_amd64.whl (55 kB)
> ---------------------------------------- 55.4/55.4 kB 1.5 MB/s eta 0:00:00
> Collecting fonttools\>=4.22.0
> Downloading fonttools-4.39.0-py3-none-any.whl (1.0 MB)
> ---------------------------------------- 1.0/1.0 MB 12.7 MB/s eta 0:00:00
> Collecting cycler\>=0.10
> Downloading cycler-0.11.0-py3-none-any.whl (6.4 kB)
> Requirement already satisfied: pillow\>=6.2.0 in c:\\users\\butlej30383\\appdata\\local\\na-mic\\slicer 5.2.2\\lib\\python\\lib\\site-packages (from matplotlib) (9.4.0)
> Requirement already satisfied: pyparsing\>=2.3.1 in c:\\users\\butlej30383\\appdata\\local\\na-mic\\slicer 5.2.2\\lib\\python\\lib\\site-packages (from matplotlib) (3.0.9)
> Requirement already satisfied: packaging\>=20.0 in c:\\users\\butlej30383\\appdata\\local\\na-mic\\slicer 5.2.2\\lib\\python\\lib\\site-packages (from matplotlib) (23.0)
> Collecting importlib-resources\>=3.2.0
> Downloading importlib\_resources-5.12.0-py3-none-any.whl (36 kB)
> Requirement already satisfied: numpy\>=1.20 in c:\\users\\butlej30383\\appdata\\local\\na-mic\\slicer 5.2.2\\lib\\python\\lib\\site-packages (from matplotlib) (1.23.4)
> Collecting contourpy\>=1.0.1
> Downloading contourpy-1.0.7-cp39-cp39-win\_amd64.whl (160 kB)
> -------------------------------------- 160.2/160.2 kB 3.2 MB/s eta 0:00:00
> Collecting zipp\>=3.1.0
> Downloading zipp-3.15.0-py3-none-any.whl (6.8 kB)
> Requirement already satisfied: six\>=1.5 in c:\\users\\butlej30383\\appdata\\local\\na-mic\\slicer 5.2.2\\lib\\python\\lib\\site-packages (from python-dateutil\>=2.7-\>matplotlib) (1.16.0)
> Installing collected packages: zipp, python-dateutil, kiwisolver, fonttools, cycler, contourpy, importlib-resources, matplotlib
> WARNING: The scripts fonttools.exe, pyftmerge.exe, pyftsubset.exe and ttx.exe are installed in 'C:\\Users\\butlej30383\\AppData\\Local\\NA-MIC\\Slicer 5.2.2\\lib\\Python\\Scripts' which is not on PATH.
> Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
> Successfully installed contourpy-1.0.7 cycler-0.11.0 fonttools-4.39.0 importlib-resources-5.12.0 kiwisolver-1.4.4 matplotlib-3.7.1 python-dateutil-2.8.2 zipp-3.15.0
> 
> \[notice\] A new release of pip is available: 23.0 -\> 23.0.1
> \[notice\] To update, run: python-real.exe -m pip install --upgrade pip
> Collecting https://github.com/wasserth/TotalSegmentator/archive/b38eb449ad8652a987878a925203cbfa354e9b85.zip
> Downloading https://github.com/wasserth/TotalSegmentator/archive/b38eb449ad8652a987878a925203cbfa354e9b85.zip
> - 5.5 MB 16.0 MB/s 0:00:00
> Preparing metadata (setup.py): started
> Preparing metadata (setup.py): finished with status 'done'
> Requirement already satisfied: numpy in c:\\users\\butlej30383\\appdata\\local\\na-mic\\slicer 5.2.2\\lib\\python\\lib\\site-packages (from TotalSegmentator==1.5.3) (1.23.4)
> Collecting psutil
> Downloading psutil-5.9.4-cp36-abi3-win\_amd64.whl (252 kB)
> -------------------------------------- 252.5/252.5 kB 2.6 MB/s eta 0:00:00
> Requirement already satisfied: SimpleITK in c:\\users\\butlej30383\\appdata\\local\\na-mic\\slicer 5.2.2\\lib\\python\\lib\\site-packages (from TotalSegmentator==1.5.3) (2.2.0rc2.dev368)
> Collecting nibabel\>=2.3.0
> Downloading nibabel-5.0.1-py3-none-any.whl (3.3 MB)
> ---------------------------------------- 3.3/3.3 MB 17.4 MB/s eta 0:00:00
> Collecting tqdm\>=4.45.0
> Downloading tqdm-4.65.0-py3-none-any.whl (77 kB)
> ---------------------------------------- 77.1/77.1 kB ? eta 0:00:00
> Collecting p\_tqdm
> Downloading p\_tqdm-1.4.0.tar.gz (5.2 kB)
> Preparing metadata (setup.py): started
> Preparing metadata (setup.py): finished with status 'done'
> Collecting xvfbwrapper
> Downloading xvfbwrapper-0.2.9.tar.gz (5.6 kB)
> Preparing metadata (setup.py): started
> Preparing metadata (setup.py): finished with status 'done'
> Collecting fury
> Downloading fury-0.8.0-py3-none-any.whl (349 kB)
> ------------------------------------- 349.2/349.2 kB 22.6 MB/s eta 0:00:00
> Collecting batchgenerators==0.21
> Downloading batchgenerators-0.21-py3-none-any.whl (74 kB)
> ---------------------------------------- 74.7/74.7 kB ? eta 0:00:00
> Collecting nnunet-customized==1.2
> Downloading nnunet\_customized-1.2-py3-none-any.whl (474 kB)
> ------------------------------------- 474.0/474.0 kB 29.0 MB/s eta 0:00:00
> Requirement already satisfied: requests in c:\\users\\butlej30383\\appdata\\local\\na-mic\\slicer 5.2.2\\lib\\python\\lib\\site-packages (from TotalSegmentator==1.5.3) (2.28.2)
> Requirement already satisfied: scipy in c:\\users\\butlej30383\\appdata\\local\\na-mic\\slicer 5.2.2\\lib\\python\\lib\\site-packages (from batchgenerators==0.21-\>TotalSegmentator==1.5.3) (1.9.2)
> Collecting future
> Downloading future-0.18.3.tar.gz (840 kB)
> ------------------------------------- 840.9/840.9 kB 51.9 MB/s eta 0:00:00
> Preparing metadata (setup.py): started
> Preparing metadata (setup.py): finished with status 'done'
> Collecting scikit-learn
> Downloading scikit\_learn-1.2.2-cp39-cp39-win\_amd64.whl (8.4 MB)
> ---------------------------------------- 8.4/8.4 MB 38.2 MB/s eta 0:00:00
> Collecting scikit-image
> Downloading scikit\_image-0.20.0-cp39-cp39-win\_amd64.whl (23.9 MB)
> --------------------------------------- 23.9/23.9 MB 28.4 MB/s eta 0:00:00
> Collecting threadpoolctl
> Downloading threadpoolctl-3.1.0-py3-none-any.whl (14 kB)
> Requirement already satisfied: pillow\>=7.1.2 in c:\\users\\butlej30383\\appdata\\local\\na-mic\\slicer 5.2.2\\lib\\python\\lib\\site-packages (from batchgenerators==0.21-\>TotalSegmentator==1.5.3) (9.4.0)
> Collecting unittest2
> Downloading unittest2-1.1.0-py2.py3-none-any.whl (96 kB)
> ---------------------------------------- 96.4/96.4 kB ? eta 0:00:00
> Collecting dicom2nifti
> Downloading dicom2nifti-2.4.8-py3-none-any.whl (43 kB)
> ---------------------------------------- 43.6/43.6 kB ? eta 0:00:00
> Collecting pandas
> Downloading pandas-1.5.3-cp39-cp39-win\_amd64.whl (10.9 MB)
> --------------------------------------- 10.9/10.9 MB 54.4 MB/s eta 0:00:00
> Collecting tifffile
> Downloading tifffile-2023.2.28-py3-none-any.whl (216 kB)
> ------------------------------------- 216.4/216.4 kB 12.9 MB/s eta 0:00:00
> Collecting medpy
> Downloading MedPy-0.4.0.tar.gz (151 kB)
> ---------------------------------------- 151.8/151.8 kB ? eta 0:00:00
> Preparing metadata (setup.py): started
> Preparing metadata (setup.py): finished with status 'done'
> Requirement already satisfied: torch\>=1.6.0a in c:\\users\\butlej30383\\appdata\\local\\na-mic\\slicer 5.2.2\\lib\\python\\lib\\site-packages (from nnunet-customized==1.2-\>TotalSegmentator==1.5.3) (2.0.0+cu118)
> Requirement already satisfied: packaging\>=17 in c:\\users\\butlej30383\\appdata\\local\\na-mic\\slicer 5.2.2\\lib\\python\\lib\\site-packages (from nibabel\>=2.3.0-\>TotalSegmentator==1.5.3) (23.0)
> Requirement already satisfied: setuptools in c:\\users\\butlej30383\\appdata\\local\\na-mic\\slicer 5.2.2\\lib\\python\\lib\\site-packages (from nibabel\>=2.3.0-\>TotalSegmentator==1.5.3) (67.0.0)
> Collecting colorama
> Downloading colorama-0.4.6-py2.py3-none-any.whl (25 kB)
> Requirement already satisfied: vtk\>=9.1.0 in c:\\users\\butlej30383\\appdata\\local\\na-mic\\slicer 5.2.2\\lib\\python\\lib\\site-packages (from fury-\>TotalSegmentator==1.5.3) (9.1.20220125)
> Collecting pathos\>=0.2.5
> Downloading pathos-0.3.0-py3-none-any.whl (79 kB)
> ---------------------------------------- 79.8/79.8 kB ? eta 0:00:00
> Requirement already satisfied: six\>=1.13.0 in c:\\users\\butlej30383\\appdata\\local\\na-mic\\slicer 5.2.2\\lib\\python\\lib\\site-packages (from p\_tqdm-\>TotalSegmentator==1.5.3) (1.16.0)
> Requirement already satisfied: idna\<4,\>=2.5 in c:\\users\\butlej30383\\appdata\\local\\na-mic\\slicer 5.2.2\\lib\\python\\lib\\site-packages (from requests-\>TotalSegmentator==1.5.3) (3.4)
> Requirement already satisfied: certifi\>=2017.4.17 in c:\\users\\butlej30383\\appdata\\local\\na-mic\\slicer 5.2.2\\lib\\python\\lib\\site-packages (from requests-\>TotalSegmentator==1.5.3) (2022.12.7)
> Requirement already satisfied: charset-normalizer\<4,\>=2 in c:\\users\\butlej30383\\appdata\\local\\na-mic\\slicer 5.2.2\\lib\\python\\lib\\site-packages (from requests-\>TotalSegmentator==1.5.3) (3.0.1)
> Requirement already satisfied: urllib3\<1.27,\>=1.21.1 in c:\\users\\butlej30383\\appdata\\local\\na-mic\\slicer 5.2.2\\lib\\python\\lib\\site-packages (from requests-\>TotalSegmentator==1.5.3) (1.26.14)
> Collecting multiprocess\>=0.70.14
> Downloading multiprocess-0.70.14-py39-none-any.whl (132 kB)
> ---------------------------------------- 132.9/132.9 kB ? eta 0:00:00
> Collecting ppft\>=1.7.6.6
> Downloading ppft-1.7.6.6-py3-none-any.whl (52 kB)
> ---------------------------------------- 52.8/52.8 kB ? eta 0:00:00
> Collecting dill\>=0.3.6
> Downloading dill-0.3.6-py3-none-any.whl (110 kB)
> ---------------------------------------- 110.5/110.5 kB ? eta 0:00:00
> Collecting pox\>=0.3.2
> Downloading pox-0.3.2-py3-none-any.whl (29 kB)
> Collecting lazy\_loader\>=0.1
> Downloading lazy\_loader-0.1-py3-none-any.whl (8.6 kB)
> Collecting PyWavelets\>=1.1.1
> Downloading PyWavelets-1.4.1-cp39-cp39-win\_amd64.whl (4.2 MB)
> ---------------------------------------- 4.2/4.2 MB 38.2 MB/s eta 0:00:00
> Requirement already satisfied: networkx\>=2.8 in c:\\users\\butlej30383\\appdata\\local\\na-mic\\slicer 5.2.2\\lib\\python\\lib\\site-packages (from scikit-image-\>batchgenerators==0.21-\>TotalSegmentator==1.5.3) (3.0)
> Collecting scipy
> Downloading scipy-1.9.1-cp39-cp39-win\_amd64.whl (38.6 MB)
> --------------------------------------- 38.6/38.6 MB 40.9 MB/s eta 0:00:00
> Collecting imageio\>=2.4.1
> Downloading imageio-2.26.0-py3-none-any.whl (3.4 MB)
> ---------------------------------------- 3.4/3.4 MB 30.8 MB/s eta 0:00:00
> Requirement already satisfied: typing-extensions in c:\\users\\butlej30383\\appdata\\local\\na-mic\\slicer 5.2.2\\lib\\python\\lib\\site-packages (from torch\>=1.6.0a-\>nnunet-customized==1.2-\>TotalSegmentator==1.5.3) (4.5.0)
> Requirement already satisfied: sympy in c:\\users\\butlej30383\\appdata\\local\\na-mic\\slicer 5.2.2\\lib\\python\\lib\\site-packages (from torch\>=1.6.0a-\>nnunet-customized==1.2-\>TotalSegmentator==1.5.3) (1.11.1)
> Requirement already satisfied: jinja2 in c:\\users\\butlej30383\\appdata\\local\\na-mic\\slicer 5.2.2\\lib\\python\\lib\\site-packages (from torch\>=1.6.0a-\>nnunet-customized==1.2-\>TotalSegmentator==1.5.3) (3.1.2)
> Requirement already satisfied: filelock in c:\\users\\butlej30383\\appdata\\local\\na-mic\\slicer 5.2.2\\lib\\python\\lib\\site-packages (from torch\>=1.6.0a-\>nnunet-customized==1.2-\>TotalSegmentator==1.5.3) (3.9.1)
> Collecting python-gdcm
> Downloading python\_gdcm-3.0.21-cp39-cp39-win\_amd64.whl (27.2 MB)
> --------------------------------------- 27.2/27.2 MB 36.4 MB/s eta 0:00:00
> Requirement already satisfied: pydicom\>=2.2.0 in c:\\users\\butlej30383\\appdata\\local\\na-mic\\slicer 5.2.2\\lib\\python\\lib\\site-packages (from dicom2nifti-\>nnunet-customized==1.2-\>TotalSegmentator==1.5.3) (2.3.1)
> Requirement already satisfied: python-dateutil\>=2.8.1 in c:\\users\\butlej30383\\appdata\\local\\na-mic\\slicer 5.2.2\\lib\\python\\lib\\site-packages (from pandas-\>nnunet-customized==1.2-\>TotalSegmentator==1.5.3) (2.8.2)
> Collecting pytz\>=2020.1
> Downloading pytz-2022.7.1-py2.py3-none-any.whl (499 kB)
> ------------------------------------- 499.4/499.4 kB 15.8 MB/s eta 0:00:00
> Collecting joblib\>=1.1.1
> Downloading joblib-1.2.0-py3-none-any.whl (297 kB)
> ------------------------------------- 298.0/298.0 kB 18.0 MB/s eta 0:00:00
> Collecting argparse
> Downloading argparse-1.4.0-py2.py3-none-any.whl (23 kB)
> Collecting traceback2
> Downloading traceback2-1.4.0-py2.py3-none-any.whl (16 kB)
> Requirement already satisfied: MarkupSafe\>=2.0 in c:\\users\\butlej30383\\appdata\\local\\na-mic\\slicer 5.2.2\\lib\\python\\lib\\site-packages (from jinja2-\>torch\>=1.6.0a-\>nnunet-customized==1.2-\>TotalSegmentator==1.5.3) (2.1.2)
> Requirement already satisfied: mpmath\>=0.19 in c:\\users\\butlej30383\\appdata\\local\\na-mic\\slicer 5.2.2\\lib\\python\\lib\\site-packages (from sympy-\>torch\>=1.6.0a-\>nnunet-customized==1.2-\>TotalSegmentator==1.5.3) (1.3.0)
> Collecting linecache2
> Downloading linecache2-1.0.0-py2.py3-none-any.whl (12 kB)
> Building wheels for collected packages: TotalSegmentator, p\_tqdm, xvfbwrapper, future, medpy
> Building wheel for TotalSegmentator (setup.py): started
> Building wheel for TotalSegmentator (setup.py): finished with status 'done'
> Created wheel for TotalSegmentator: filename=TotalSegmentator-1.5.3-py3-none-any.whl size=40473 sha256=72631d27e92da70d44e97e4309a78d20e685ff9af743f96d7e69538a655f33f7
> Stored in directory: C:\\Users\\butlej30383\\AppData\\Local\\Temp\\pip-ephem-wheel-cache-98sqy9xm\\wheels\\9f\\4f\\c3\\aa92a6088ded23ae736534c7fd546ac5aec3409f87bbed6852
> Building wheel for p\_tqdm (setup.py): started
> Building wheel for p\_tqdm (setup.py): finished with status 'done'
> Created wheel for p\_tqdm: filename=p\_tqdm-1.4.0-py3-none-any.whl size=5411 sha256=fa28bb84f74c368e3ca9f728cac1ce3da2df3fb07f95dcf27cf8d23c317ab512
> Stored in directory: c:\\users\\butlej30383\\appdata\\local\\pip\\cache\\wheels\\53\\8b\\76\\19cce68cdb3253aee026a593ec9bc772607b85193cf65e1f53
> Building wheel for xvfbwrapper (setup.py): started
> Building wheel for xvfbwrapper (setup.py): finished with status 'done'
> Created wheel for xvfbwrapper: filename=xvfbwrapper-0.2.9-py3-none-any.whl size=5027 sha256=b15a6b7c25585d54d8fb6e75a0c52c862db0ca6335cbbb1f53a9fb4607d54d0d
> Stored in directory: c:\\users\\butlej30383\\appdata\\local\\pip\\cache\\wheels\\aa\\09\\0e\\c0fa4c721cfb0a003121597a24181add912b7488054d2311ad
> Building wheel for future (setup.py): started
> Building wheel for future (setup.py): finished with status 'done'
> Created wheel for future: filename=future-0.18.3-py3-none-any.whl size=492055 sha256=e5d845853ca1d4176cfadcbc5699dbe1277875648cb957ad91f9787813b5c77a
> Stored in directory: c:\\users\\butlej30383\\appdata\\local\\pip\\cache\\wheels\\bf\\5d\\6a\\2e53874f7ec4e2bede522385439531fafec8fafe005b5c3d1b
> Building wheel for medpy (setup.py): started
> Building wheel for medpy (setup.py): finished with status 'done'
> Created wheel for medpy: filename=MedPy-0.4.0-py3-none-any.whl size=215911 sha256=47f6a0c552cdc868104caf188bd34e85fbd5fd46a2882b6893bc782b1b948d8c
> Stored in directory: c:\\users\\butlej30383\\appdata\\local\\pip\\cache\\wheels\\41\\46\\a2\\7c585b78f216a3dd8723dbab5f439822fa5dfbff563757a49e
> Successfully built TotalSegmentator p\_tqdm xvfbwrapper future medpy
> Installing collected packages: xvfbwrapper, pytz, linecache2, argparse, traceback2, tifffile, threadpoolctl, scipy, PyWavelets, python-gdcm, psutil, ppft, pox, nibabel, lazy\_loader, joblib, imageio, future, dill, colorama, unittest2, tqdm, scikit-learn, scikit-image, pandas, multiprocess, medpy, fury, dicom2nifti, pathos, batchgenerators, p\_tqdm, nnunet-customized, TotalSegmentator
> WARNING: The scripts lsm2bin.exe, tiff2fsspec.exe, tiffcomment.exe and tifffile.exe are installed in 'C:\\Users\\butlej30383\\AppData\\Local\\NA-MIC\\Slicer 5.2.2\\lib\\Python\\Scripts' which is not on PATH.
> Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
> Attempting uninstall: scipy
> Found existing installation: scipy 1.9.2
> Uninstalling scipy-1.9.2:
> Successfully uninstalled scipy-1.9.2
> ERROR: Could not install packages due to an OSError: \[WinError 5\] Access is denied: 'C:\\\\Users\\\\butlej30383\\\\AppData\\\\Local\\\\NA-MIC\\\\Slicer 5.2.2\\\\lib\\\\Python\\\\Lib\\\\site-packages\\\\~cipy\\\\\_lib\\\\\_ccallback\_c.cp39-win\_amd64.pyd'
> Consider using the \`--user\` option or check the permissions.
> 
> 
> \[notice\] A new release of pip is available: 23.0 -\> 23.0.1
> \[notice\] To update, run: python-real.exe -m pip install --upgrade pip
> \[Python\] Failed to compute results.
> \[Python\] Command '\['C:/Users/butlej30383/AppData/Local/NA-MIC/Slicer 5.2.2/bin/../bin\\\\PythonSlicer.EXE', '-m', 'pip', 'install', 'https://github.com/wasserth/TotalSegmentator/archive/b38eb449ad8652a987878a925203cbfa354e9b85.zip'\]' returned non-zero exit status 1.
> Traceback (most recent call last):
> File "C:/GitHub/SlicerTotalSegmentator/TotalSegmentator/TotalSegmentator.py", line 255, in onApplyButton
> self.logic.setupPythonRequirements()
> File "C:/GitHub/SlicerTotalSegmentator/TotalSegmentator/TotalSegmentator.py", line 624, in setupPythonRequirements
> slicer.util.pip\_install(self.totalSegmentatorPythonPackageDownloadUrl)
> File "C:\\Users\\butlej30383\\AppData\\Local\\NA-MIC\\Slicer 5.2.2\\bin\\Python\\slicer\\util.py", line 3578, in pip\_install
> \_executePythonModule('pip', args)
> File "C:\\Users\\butlej30383\\AppData\\Local\\NA-MIC\\Slicer 5.2.2\\bin\\Python\\slicer\\util.py", line 3540, in \_executePythonModule
> logProcessOutput(proc)
> File "C:\\Users\\butlej30383\\AppData\\Local\\NA-MIC\\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/butlej30383/AppData/Local/NA-MIC/Slicer 5.2.2/bin/../bin\\\\PythonSlicer.EXE', '-m', 'pip', 'install', 'https://github.com/wasserth/TotalSegmentator/archive/b38eb449ad8652a987878a925203cbfa354e9b85.zip'\]' returned non-zero exit status 1.
> \</details\>

---

<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:** [March 14, 2023, 7:45pm UTC](https://discourse.slicer.org/t/total-segmentor-lung-basic-bug-report-on-version-5-2-2-while-working-perfectly-on-5-2-1/28238/11 "2023-03-14T19:45:48Z")

</div>

@lassoan can we not just force a restart after TS installation?
