# Slicer superbuild error in Python/SSL

**URL:** <https://discourse.slicer.org/t/slicer-superbuild-error-in-python-ssl/33669>\
**Category:** Development\
**Tags:** build\
**Created:** [January 8, 2024, 12:49pm UTC](https://discourse.slicer.org/t/slicer-superbuild-error-in-python-ssl/33669 "2024-01-08T12:49:19Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![cpinter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/cpinter/32/7995_2.png) [@cpinter](https://discourse.slicer.org/u/cpinter)\
**Post date:** [January 8, 2024, 12:49pm UTC](https://discourse.slicer.org/t/slicer-superbuild-error-in-python-ssl/33669/1 "2024-01-08T12:49:20Z")

</div>

Hi all,

I have updated the Slicer source code to the latest and trying to build it. On one computer the build succeeded, but on the other one I keep getting the same error. I tried it several times during the last days at the latest commit so it is not something very recent.

The error is:

```auto
  CMake Error at C:/d/S5R/python-setuptools-prefix/src/python-setuptools-stamp/python-setuptools-install-Release.cmake:49 (message):
    Command failed: 1
     'C:/d/S5R/python-install/bin/PythonSlicer.exe' '-m' 'pip' 'install' '--require-hashes' '-r' 'C:/d/S5R/python-setuptools-requirements.txt'
    See also
      C:/d/S5R/python-setuptools-prefix/src/python-setuptools-stamp/python-setuptools-install-*.log

```

and in the referred file I have this:

```auto
  WARNING: Certificate did not match expected hostname: files.pythonhosted.org. Certificate: {'subject': ((('commonName', 'r.shared-319-default.ssl.fastly.net'),),), 'issuer': ((('countryName', 'BE'),), (('organizationName', 'GlobalSign nv-sa'),), (('commonName', 'GlobalSign Atlas R3 DV TLS CA 2023 Q1'),)), 'version': 3, 'serialNumber': '01D06257899F0DD2481ECE65A0533F7E', 'notBefore': 'Apr 10 04:55:11 2023 GMT', 'notAfter': 'May 11 04:55:10 2024 GMT', 'subjectAltName': (('DNS', 'r.shared-319-default.ssl.fastly.net'),), 'OCSP': ('http://ocsp.globalsign.com/ca/gsatlasr3dvtlsca2023q1',), 'caIssuers': ('http://secure.globalsign.com/cacert/gsatlasr3dvtlsca2023q1.crt',), 'crlDistributionPoints': ('http://crl.globalsign.com/ca/gsatlasr3dvtlsca2023q1.crl',)}
  WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCertVerificationError("hostname 'files.pythonhosted.org' doesn't match 'r.shared-319-default.ssl.fastly.net'"))': /packages/bb/26/7945080113158354380a12ce26873dd6c1ebd88d47f5bc24e2c5bb38c16a/setuptools-68.2.2-py3-none-any.whl
  WARNING: Certificate did not match expected hostname: files.pythonhosted.org. Certificate: {'subject': ((('commonName', 'r.shared-319-default.ssl.fastly.net'),),), 'issuer': ((('countryName', 'BE'),), (('organizationName', 'GlobalSign nv-sa'),), (('commonName', 'GlobalSign Atlas R3 DV TLS CA 2023 Q1'),)), 'version': 3, 'serialNumber': '01D06257899F0DD2481ECE65A0533F7E', 'notBefore': 'Apr 10 04:55:11 2023 GMT', 'notAfter': 'May 11 04:55:10 2024 GMT', 'subjectAltName': (('DNS', 'r.shared-319-default.ssl.fastly.net'),), 'OCSP': ('http://ocsp.globalsign.com/ca/gsatlasr3dvtlsca2023q1',), 'caIssuers': ('http://secure.globalsign.com/cacert/gsatlasr3dvtlsca2023q1.crt',), 'crlDistributionPoints': ('http://crl.globalsign.com/ca/gsatlasr3dvtlsca2023q1.crl',)}
  WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCertVerificationError("hostname 'files.pythonhosted.org' doesn't match 'r.shared-319-default.ssl.fastly.net'"))': /packages/bb/26/7945080113158354380a12ce26873dd6c1ebd88d47f5bc24e2c5bb38c16a/setuptools-68.2.2-py3-none-any.whl
  WARNING: Certificate did not match expected hostname: files.pythonhosted.org. Certificate: {'subject': ((('commonName', 'r.shared-319-default.ssl.fastly.net'),),), 'issuer': ((('countryName', 'BE'),), (('organizationName', 'GlobalSign nv-sa'),), (('commonName', 'GlobalSign Atlas R3 DV TLS CA 2023 Q1'),)), 'version': 3, 'serialNumber': '01D06257899F0DD2481ECE65A0533F7E', 'notBefore': 'Apr 10 04:55:11 2023 GMT', 'notAfter': 'May 11 04:55:10 2024 GMT', 'subjectAltName': (('DNS', 'r.shared-319-default.ssl.fastly.net'),), 'OCSP': ('http://ocsp.globalsign.com/ca/gsatlasr3dvtlsca2023q1',), 'caIssuers': ('http://secure.globalsign.com/cacert/gsatlasr3dvtlsca2023q1.crt',), 'crlDistributionPoints': ('http://crl.globalsign.com/ca/gsatlasr3dvtlsca2023q1.crl',)}
  WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCertVerificationError("hostname 'files.pythonhosted.org' doesn't match 'r.shared-319-default.ssl.fastly.net'"))': /packages/bb/26/7945080113158354380a12ce26873dd6c1ebd88d47f5bc24e2c5bb38c16a/setuptools-68.2.2-py3-none-any.whl
  WARNING: Certificate did not match expected hostname: files.pythonhosted.org. Certificate: {'subject': ((('commonName', 'r.shared-319-default.ssl.fastly.net'),),), 'issuer': ((('countryName', 'BE'),), (('organizationName', 'GlobalSign nv-sa'),), (('commonName', 'GlobalSign Atlas R3 DV TLS CA 2023 Q1'),)), 'version': 3, 'serialNumber': '01D06257899F0DD2481ECE65A0533F7E', 'notBefore': 'Apr 10 04:55:11 2023 GMT', 'notAfter': 'May 11 04:55:10 2024 GMT', 'subjectAltName': (('DNS', 'r.shared-319-default.ssl.fastly.net'),), 'OCSP': ('http://ocsp.globalsign.com/ca/gsatlasr3dvtlsca2023q1',), 'caIssuers': ('http://secure.globalsign.com/cacert/gsatlasr3dvtlsca2023q1.crt',), 'crlDistributionPoints': ('http://crl.globalsign.com/ca/gsatlasr3dvtlsca2023q1.crl',)}
  WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCertVerificationError("hostname 'files.pythonhosted.org' doesn't match 'r.shared-319-default.ssl.fastly.net'"))': /packages/bb/26/7945080113158354380a12ce26873dd6c1ebd88d47f5bc24e2c5bb38c16a/setuptools-68.2.2-py3-none-any.whl
  WARNING: Certificate did not match expected hostname: files.pythonhosted.org. Certificate: {'subject': ((('commonName', 'r.shared-319-default.ssl.fastly.net'),),), 'issuer': ((('countryName', 'BE'),), (('organizationName', 'GlobalSign nv-sa'),), (('commonName', 'GlobalSign Atlas R3 DV TLS CA 2023 Q1'),)), 'version': 3, 'serialNumber': '01D06257899F0DD2481ECE65A0533F7E', 'notBefore': 'Apr 10 04:55:11 2023 GMT', 'notAfter': 'May 11 04:55:10 2024 GMT', 'subjectAltName': (('DNS', 'r.shared-319-default.ssl.fastly.net'),), 'OCSP': ('http://ocsp.globalsign.com/ca/gsatlasr3dvtlsca2023q1',), 'caIssuers': ('http://secure.globalsign.com/cacert/gsatlasr3dvtlsca2023q1.crt',), 'crlDistributionPoints': ('http://crl.globalsign.com/ca/gsatlasr3dvtlsca2023q1.crl',)}
  WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCertVerificationError("hostname 'files.pythonhosted.org' doesn't match 'r.shared-319-default.ssl.fastly.net'"))': /packages/bb/26/7945080113158354380a12ce26873dd6c1ebd88d47f5bc24e2c5bb38c16a/setuptools-68.2.2-py3-none-any.whl
  WARNING: Certificate did not match expected hostname: files.pythonhosted.org. Certificate: {'subject': ((('commonName', 'r.shared-319-default.ssl.fastly.net'),),), 'issuer': ((('countryName', 'BE'),), (('organizationName', 'GlobalSign nv-sa'),), (('commonName', 'GlobalSign Atlas R3 DV TLS CA 2023 Q1'),)), 'version': 3, 'serialNumber': '01D06257899F0DD2481ECE65A0533F7E', 'notBefore': 'Apr 10 04:55:11 2023 GMT', 'notAfter': 'May 11 04:55:10 2024 GMT', 'subjectAltName': (('DNS', 'r.shared-319-default.ssl.fastly.net'),), 'OCSP': ('http://ocsp.globalsign.com/ca/gsatlasr3dvtlsca2023q1',), 'caIssuers': ('http://secure.globalsign.com/cacert/gsatlasr3dvtlsca2023q1.crt',), 'crlDistributionPoints': ('http://crl.globalsign.com/ca/gsatlasr3dvtlsca2023q1.crl',)}
ERROR: Could not install packages due to an OSError: HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Max retries exceeded with url: /packages/bb/26/7945080113158354380a12ce26873dd6c1ebd88d47f5bc24e2c5bb38c16a/setuptools-68.2.2-py3-none-any.whl (Caused by SSLError(SSLCertVerificationError("hostname 'files.pythonhosted.org' doesn't match 'r.shared-319-default.ssl.fastly.net'")))

WARNING: You are using pip version 21.2.4; however, version 23.3.2 is available.
You should consider upgrading via the 'C:\d\S5R\python-install\bin\python.exe -m pip install --upgrade pip' command.

```

I updated CMake to the latest, and it failed the same way. I do not use any special CMake options with the superbuild. I use VS17 2022, and Qt 5.15.2. The computer is question has Windows 10, and I am trying to build in Release mode.

Does anyone have any suggestion? Thanks a lot!

---

<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:** [January 8, 2024, 1:01pm UTC](https://discourse.slicer.org/t/slicer-superbuild-error-in-python-ssl/33669/2 "2024-01-08T13:01:33Z")

</div>

I build the same configuration and haven’t run into this issue. I last built about 2 weeks ago.

Since it worked on one computer, but not another definitely seems to point to a network issue for that one computer. Is it connected to a VPN or behind some corporate firewall? Anything else about that computer’s networking capabilities compared to the one that works?

---

<div class="post-metadata">

**Author:** ![cpinter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/cpinter/32/7995_2.png) [@cpinter](https://discourse.slicer.org/u/cpinter)\
**Post date:** [January 8, 2024, 1:15pm UTC](https://discourse.slicer.org/t/slicer-superbuild-error-in-python-ssl/33669/3 "2024-01-08T13:15:47Z")

</div>

Thanks James! It is not behind firewall or VPN. It has a wired connection to the internet and since I tried to build it around 5 times and the superbuild needs to check out many GitHub repos etc, and it always failed the same place, I am quite certain it’s not about the connection. I can build older Slicer and custom app on the same computer.

If I had to guess I’d say it must be something in the requirements that changed in the past few months.

---

<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:** [January 8, 2024, 3:08pm UTC](https://discourse.slicer.org/t/slicer-superbuild-error-in-python-ssl/33669/4 "2024-01-08T15:08:29Z")

</div>

Is the computer that is having problems able to go to [https://files.pythonhosted.org/](https://files.pythonhosted.org/) successfully through a browser?

Doing a google search of the error you encounter brought me to the following page with the same description and another user provided a method of how they resolved it:

> <https://stackoverflow.com/questions/77630264/could-not-install-packages-due-to-an-oserror-while-trying-to-download-python-p>

---

<div class="post-metadata">

**Author:** ![cpinter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/cpinter/32/7995_2.png) [@cpinter](https://discourse.slicer.org/u/cpinter)\
**Post date:** [January 8, 2024, 3:45pm UTC](https://discourse.slicer.org/t/slicer-superbuild-error-in-python-ssl/33669/5 "2024-01-08T15:45:07Z")

</div>

Thanks again.

[https://files.pythonhosted.org/](https://files.pythonhosted.org/) is available from the computer where build was successful but not on the computer where it kept failing (getting a “Your connection is not private” error).

I’ll try the method you pointed out on stackoverflow.

---

<div class="post-metadata">

**Author:** ![cpinter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/cpinter/32/7995_2.png) [@cpinter](https://discourse.slicer.org/u/cpinter)\
**Post date:** [January 8, 2024, 7:42pm UTC](https://discourse.slicer.org/t/slicer-superbuild-error-in-python-ssl/33669/6 "2024-01-08T19:42:19Z")

</div>

The build is proceeding, and I got a “Completed ‘python-setuptools’” message in CMake, so it seems to be working. I just realize the computer wasn’t restarted for months so either that was the problem, or the [solution](https://stackoverflow.com/questions/77630264/could-not-install-packages-due-to-an-oserror-while-trying-to-download-python-p) @jamesobutler suggested did the trick.

Thanks a lot for the quick help!
