# SSL error when Lung CT segmenter is trying to instal light-the-torch

**URL:** <https://discourse.slicer.org/t/ssl-error-when-lung-ct-segmenter-is-trying-to-instal-light-the-torch/28774>\
**Category:** Support\
**Tags:** segmentation, lungctanalyzer, lung\
**Created:** [April 6, 2023, 3:58am UTC](https://discourse.slicer.org/t/ssl-error-when-lung-ct-segmenter-is-trying-to-instal-light-the-torch/28774 "2023-04-06T03:58:32Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![wangjianmerci](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/wangjianmerci/32/17372_2.png) [@wangjianmerci](https://discourse.slicer.org/u/wangjianmerci)\
**Post date:** [April 6, 2023, 3:58am UTC](https://discourse.slicer.org/t/ssl-error-when-lung-ct-segmenter-is-trying-to-instal-light-the-torch/28774/1 "2023-04-06T03:58:32Z")

</div>

Operating system:Windows  
Slicer version:5.2.2  
Hardware：R7-5800H+32G+3060laptop（6G）  
When I want use AI Lung lobe segmenter in 3dslicer 5.2.2, it asked to install _ **light-the-torch** _.

 ![微信图片_20230406113641](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/b/c/bc15515c0e840c4a960d4657c6214a4310d8a595.jpeg)

But error .

 ![微信图片_20230406113700](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/e/d/edcbf45e82f3e40e95ebac2e4300f6f2a8a4cb64.jpeg)

```auto
[Qt] ctkSliderWidget::setSingleStep() 0 is out of bounds. 0 1000 1
Exception ignored in: <function SegmentEditorEffect. __del__ at 0x00000248AFCE1940>
Traceback (most recent call last):
  File "E:/3dslicerreport/3dslicer/Slicer 5.2.2/NA-MIC/Extensions-31382/NvidiaAIAssistedAnnotation/lib/Slicer-5.2/qt-scripted-modules/SegmentEditorNvidiaAIAALib/SegmentEditorEffect.py", line 59, in __del__
    AbstractScriptedSegmentEditorEffect. __del__ (self)
AttributeError: type object 'AbstractScriptedSegmentEditorEffect' has no attribute ' __del__'
[Qt] QLayout::addChildLayout: layout "" already has a parent
[Qt] ctkSliderWidget::setSingleStep() 0 is out of bounds. 0 1000 1
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:1129)'))': /simple/light-the-torch/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:1129)'))': /simple/light-the-torch/
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:1129)'))': /simple/light-the-torch/
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:1129)'))': /simple/light-the-torch/
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:1129)'))': /simple/light-the-torch/
Could not fetch URL https://pypi.org/simple/light-the-torch/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/light-the-torch/ (Caused by SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:1129)'))) - skipping
ERROR: Could not find a version that satisfies the requirement light-the-torch>=0.5 (from versions: none)
ERROR: No matching distribution found for light-the-torch>=0.5
Could not fetch URL https://pypi.org/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:1129)'))) - skipping
[Python] Failed to compute results: Command '['E:/3dslicerreport/3dslicer/Slicer 5.2.2/bin/../bin\\PythonSlicer.EXE', '-m', 'pip', 'install', 'light-the-torch>=0.5']' returned non-zero exit status 1.
Traceback (most recent call last):
  File "E:/3dslicerreport/3dslicer/Slicer 5.2.2/NA-MIC/Extensions-31382/PyTorch/lib/Slicer-5.2/qt-scripted-modules/PyTorchUtils.py", line 182, in installTorch
    import light_the_torch._patch
ModuleNotFoundError: No module named 'light_the_torch'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "E:/3dslicerreport/3dslicer/Slicer 5.2.2/NA-MIC/Extensions-31382/LungCTAnalyzer/lib/Slicer-5.2/qt-scripted-modules/LungCTSegmenter.py", line 970, in runProcessing
    self.logic.applySegmentation()
  File "E:/3dslicerreport/3dslicer/Slicer 5.2.2/NA-MIC/Extensions-31382/LungCTAnalyzer/lib/Slicer-5.2/qt-scripted-modules/LungCTSegmenter.py", line 2181, in applySegmentation
    torch = torchLogic.installTorch(askConfirmation=True)
  File "E:/3dslicerreport/3dslicer/Slicer 5.2.2/NA-MIC/Extensions-31382/PyTorch/lib/Slicer-5.2/qt-scripted-modules/PyTorchUtils.py", line 184, in installTorch
    PyTorchUtilsLogic._installLightTheTorch()
  File "E:/3dslicerreport/3dslicer/Slicer 5.2.2/NA-MIC/Extensions-31382/PyTorch/lib/Slicer-5.2/qt-scripted-modules/PyTorchUtils.py", line 206, in _installLightTheTorch
    slicer.util.pip_install('light-the-torch>=0.5')
  File "E:\3dslicerreport\3dslicer\Slicer 5.2.2\bin\Python\slicer\util.py", line 3578, in pip_install
    _executePythonModule('pip', args)
  File "E:\3dslicerreport\3dslicer\Slicer 5.2.2\bin\Python\slicer\util.py", line 3540, in _executePythonModule
    logProcessOutput(proc)
  File "E:\3dslicerreport\3dslicer\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 '['E:/3dslicerreport/3dslicer/Slicer 5.2.2/bin/../bin\\PythonSlicer.EXE', '-m', 'pip', 'install', 'light-the-torch>=0.5']' returned non-zero exit status 1.
[VTK] Warning: In D:\D\S\S-0\Libs\MRML\Core\vtkMRMLSegmentationDisplayNode.cxx, line 287
[VTK] vtkMRMLSegmentationDisplayNode (000002492002D5C0): vtkMRMLSegmentationDisplayNode::GetSegmentDisplayProperties: no display properties are found for segment ID=, return default

```

I tried to install by codes:  
`slicer.util.pip_install("light-the-torch>=0.5")`

```auto
>>> slicer.util.pip_install("light-the-torch>=0.5")
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:1129)'))': /simple/light-the-torch/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:1129)'))': /simple/light-the-torch/
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:1129)'))': /simple/light-the-torch/
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:1129)'))': /simple/light-the-torch/
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:1129)'))': /simple/light-the-torch/
Could not fetch URL https://pypi.org/simple/light-the-torch/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/light-the-torch/ (Caused by SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:1129)'))) - skipping
ERROR: Could not find a version that satisfies the requirement light-the-torch>=0.5 (from versions: none)
ERROR: No matching distribution found for light-the-torch>=0.5
Could not fetch URL https://pypi.org/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:1129)'))) - skipping
Traceback (most recent call last):
  File "<console>", line 1, in <module>
  File "E:\3dslicerreport\3dslicer\Slicer 5.2.2\bin\Python\slicer\util.py", line 3578, in pip_install
    _executePythonModule('pip', args)
  File "E:\3dslicerreport\3dslicer\Slicer 5.2.2\bin\Python\slicer\util.py", line 3540, in _executePythonModule
    logProcessOutput(proc)
  File "E:\3dslicerreport\3dslicer\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 '['E:/3dslicerreport/3dslicer/Slicer 5.2.2/bin/../bin\\PythonSlicer.EXE', '-m', 'pip', 'install', 'light-the-torch>=0.5']' returned non-zero exit status 1.

```

How could I solve the problem? Appreciate your help！

---

<div class="post-metadata">

**Author:** ![muratmaga](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/muratmaga/32/3622_2.png) [@muratmaga](https://discourse.slicer.org/u/muratmaga)\
**Post date:** [April 6, 2023, 5:18am UTC](https://discourse.slicer.org/t/ssl-error-when-lung-ct-segmenter-is-trying-to-instal-light-the-torch/28774/2 "2023-04-06T05:18:48Z")

</div>

> [@wangjianmerci](#):
>
> How could I solve the problem? Appreciate your help！

Did you try the PyTorch extension? Install the extension, switch to the pytorch module and then choose the automatic method. Then re-try the Lung CT Segmenter

---

<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:** [April 6, 2023, 6:26am UTC](https://discourse.slicer.org/t/ssl-error-when-lung-ct-segmenter-is-trying-to-instal-light-the-torch/28774/3 "2023-04-06T06:26:53Z")

</div>

Yes, please use the PyTorch extension to install the torch dependencies.

---

<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, 2023, 1:09pm UTC](https://discourse.slicer.org/t/ssl-error-when-lung-ct-segmenter-is-trying-to-instal-light-the-torch/28774/4 "2023-04-06T13:09:00Z")

</div>

> [@wangjianmerci](#):
>
> `Could not fetch URL https://pypi.org/simple/light-the-torch/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/light-the-torch/ (Caused by SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:1129)'))) - skipping`

It is an SSL error. Most likely you are connecting to the internet via a proxy server/VPN/firewall that messes with your connection. Can you connect to the internet directly?

---

<div class="post-metadata">

**Author:** ![wangjianmerci](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/wangjianmerci/32/17372_2.png) [@wangjianmerci](https://discourse.slicer.org/u/wangjianmerci)\
**Post date:** [April 6, 2023, 4:08pm UTC](https://discourse.slicer.org/t/ssl-error-when-lung-ct-segmenter-is-trying-to-instal-light-the-torch/28774/5 "2023-04-06T16:08:09Z")

</div>

@muratmaga @muratmaga @lassoan , \*Thank you so much, I really appreciate your help!  
I reinstall _ **PyTorch extension** _, and try again. It really works. But download speed is very slow(\<30kb/s) cause the _Great FireWall_. Beacause the slow speed, net had dissconnected many times.  
So I meet the dilemma that download speed really slow without a proxy or can not fetch URL via proxy.

---

<div class="post-metadata">

**Author:** ![muratmaga](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/muratmaga/32/3622_2.png) [@muratmaga](https://discourse.slicer.org/u/muratmaga)\
**Post date:** [April 6, 2023, 4:12pm UTC](https://discourse.slicer.org/t/ssl-error-when-lung-ct-segmenter-is-trying-to-instal-light-the-torch/28774/6 "2023-04-06T16:12:03Z")

</div>

Whether you use through pip\_install or via extension, they are going to bring the same package one way or the other. Perhaps what you can do is to obtain the correct wheel name from the pytorch logs, download in a different manner where you can reconnect and continue (curl? wget?), and once you get a copy of the wheel use the pip\_install, but ask to use the local file.

---

<div class="post-metadata">

**Author:** ![wangjianmerci](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/wangjianmerci/32/17372_2.png) [@wangjianmerci](https://discourse.slicer.org/u/wangjianmerci)\
**Post date:** [April 7, 2023, 2:41am UTC](https://discourse.slicer.org/t/ssl-error-when-lung-ct-segmenter-is-trying-to-instal-light-the-torch/28774/8 "2023-04-07T02:41:27Z")

</div>

Thank you for your valuable advice. Actually, I want to figure out a way can download the packages manual, and install locally. But I really don’t how to do in 3dslicer.

---

<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 15, 2023, 4:44pm UTC](https://discourse.slicer.org/t/ssl-error-when-lung-ct-segmenter-is-trying-to-instal-light-the-torch/28774/9 "2023-04-15T16:44:09Z")

</div>

You can download and pip install packages in Slicer’s Python environment the same way as in any other Python environment. The Python interpreter exectuable is `PythonSlicer`, so you can for example install a package like this: `PythonSlicer -m pip install packagename`

---

<div class="post-metadata">

**Author:** ![wangjianmerci](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/wangjianmerci/32/17372_2.png) [@wangjianmerci](https://discourse.slicer.org/u/wangjianmerci)\
**Post date:** [August 2, 2023, 1:33am UTC](https://discourse.slicer.org/t/ssl-error-when-lung-ct-segmenter-is-trying-to-instal-light-the-torch/28774/10 "2023-08-02T01:33:44Z")

</div>

my computer can’t install _lungmask_ automatically cause the Internet limits.

```auto
Collecting https://github.com/JoHof/lungmask/archive/master.zip
  WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:1129)'))': /JoHof/lungmask/archive/master.zip
  WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:1129)'))': /JoHof/lungmask/archive/master.zip
  WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:1129)'))': /JoHof/lungmask/archive/master.zip
  WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:1129)'))': /JoHof/lungmask/archive/master.zip
  WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:1129)'))': /JoHof/lungmask/archive/master.zip
ERROR: Could not install packages due to an OSError: HTTPSConnectionPool(host='github.com', port=443): Max retries exceeded with url: /JoHof/lungmask/archive/master.zip (Caused by SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:1129)')))

```

so can I install the package manual ?

---

<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 2, 2023, 3:48am UTC](https://discourse.slicer.org/t/ssl-error-when-lung-ct-segmenter-is-trying-to-instal-light-the-torch/28774/11 "2023-08-02T03:48:48Z")

</div>

The AI model is stored on github, so you need to resolve your internet connectivity to github. For example, you may try to use a VPN.

---

<div class="post-metadata">

**Author:** ![wangjianmerci](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/wangjianmerci/32/17372_2.png) [@wangjianmerci](https://discourse.slicer.org/u/wangjianmerci)\
**Post date:** [August 2, 2023, 8:54am UTC](https://discourse.slicer.org/t/ssl-error-when-lung-ct-segmenter-is-trying-to-instal-light-the-torch/28774/12 "2023-08-02T08:54:45Z")

</div>

Thank you a lot . I tried to download on GitHub and installed manual in terminal. It really worked. thanks again !
