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

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.

But error .

[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")

>>> 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!

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

1 Like

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

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?

@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.

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.

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.

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

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

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 ?

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.

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

1 Like