AIX Open Source

AIX Open Source

Share your experiences and connect with fellow developers to discover how to build and manage open source software for the AIX operating system

 View Only
Expand all | Collapse all

python: pip install error "pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available"

  • 1.  python: pip install error "pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available"

    Posted Mon March 11, 2019 09:39 AM

    Originally posted by: ctremel


    this error qualifies for both python and python3 packages.

    when trying to install moules via pip(3) the following error is produced.  maybe  the packages are not  linked  against openssl?

     

    root@sag0103: /root # pip3 install pytz
    pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
    Collecting pytz
      Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/pytz/
      Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/pytz/
      Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/pytz/
      Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/pytz/
    Operation cancelled by user
    pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
    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("Can't connect to HTTPS URL because the SSL module is not available.")) - skipping

    this is a serious showstopper and needs to be fixed asap.

     

     



  • 2.  Re: python: pip install error "pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available"

    Posted Mon March 11, 2019 09:54 AM

    Originally posted by: AyappanP


    There is something wrong with your environment.

    Please check whether your ssl is working ( through some commands like curl., etc )

    I just tried to install pytz and it worked.

    # python3 -m pip install pytz
    Collecting pytz
      Downloading https://files.pythonhosted.org/packages/61/28/1d3920e4d1d50b19bc5d24398a7cd85cc7b9a75a490570d5a30c57622d34/pytz-2018.9-py2.py3-none-any.whl (510kB)
        100% |################################| 512kB 1.3MB/s
    Installing collected packages: pytz
    Successfully installed pytz-2018.9
     



  • 3.  Re: python: pip install error "pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available"

    Posted Mon March 11, 2019 10:02 AM

    Originally posted by: ctremel


    curl ssl work perfectly. to which "environment" are you reffering to? seems to be a isolated python problem.

     

    root@sag0103: /root # curl -v https://www.google.com 2>&1 | awk 'BEGIN { cert=0 } /^\* Server certificate:/ { cert=1 } /^\*/ { if (cert) print }'
    * Server certificate:
    *  subject: C=US; ST=California; L=Mountain View; O=Google LLC; CN=www.google.com
    *  start date: Mar  1 09:46:35 2019 GMT
    *  expire date: May 24 09:25:00 2019 GMT
    *  subjectAltName: host "www.google.com" matched cert's "www.google.com"
    *  issuer: C=US; O=Google Trust Services; CN=Google Internet Authority G3
    *  SSL certificate verify ok.
    * Connection #0 to host proxy.sozvers.at left intact

     

    update:

     

    tried it on another lpar, same error.

     

    root@hsr1s6p3: /root # python3 -m pip install pip
    pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
    Requirement already satisfied: pip in /opt/freeware/lib/python3.7/site-packages (10.0.1)
    pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
    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("Can't connect to HTTPS URL because the SSL module is not available.")) - skipping
    root@hsr1s6p3: /root # python3 -m pip install pip3
    pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
    Collecting pip3
      Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/pip3/
      Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/pip3/
      Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/pip3/
    Operation cancelled by user
    pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
    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("Can't connect to HTTPS URL because the SSL module is not available.")) - skipping

     

     



  • 4.  Re: python: pip install error "pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available"

    Posted Mon March 11, 2019 10:43 AM

    Originally posted by: ctremel


    here's the culprit

     

    root@sag0103: /root # python3
    Python 3.7.1 (default, Jan 11 2019, 17:16:05)
    [GCC 6.3.0] on aix6
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import ssl
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "/opt/freeware/lib64/python3.7/ssl.py", line 98, in <module>
        import _ssl             # if we can't import it, let the error propagate
    ImportError: Could not load module /opt/freeware/lib64/python3.7/lib-dynload/_ssl.so.
            Dependent module /usr/lib/libssl.a(libssl.so.1.0.2) could not be loaded.
            Member libssl.so.1.0.2 is not found in archive
    Could not load module /opt/freeware/lib64/python3.7/lib-dynload/_ssl.so.
            Dependent module /opt/freeware/lib64/python3.7/lib-dynload/_ssl.so could not be loaded.

    no idea how to proceed from here, because the aix openssl lpp is installed?



  • 5.  Re: python: pip install error "pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available"

    Posted Mon March 11, 2019 10:52 AM

    Originally posted by: AyappanP


    libssl.a(libssl.so.1.0.2) is a dependency for AIX Toolbox Python3 -3.7.1 .

    I am not sure how you installed python3 rpm in the first place (May be you have openssl rpm installed ? )

    You can download the latest openssl from AIX web download pack programs https://www14.software.ibm.com/webapp/iwm/web/preLogin.do?source=aixbp

    Install it and run "updtvpkg". 

    Note: If you have openssl rpm installed, please remove it before installing the openssl fileset.



  • 6.  Re: python: pip install error "pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available"

    Posted Tue March 12, 2019 10:28 AM

    Originally posted by: @AAB


    That should be version of SSL or environment.

    1. If lslpp -L | grep -i openssl.base shows 1.0.2.1601 version , can you try this :

    root@test1:/root# export LIBPATH=/usr/lib:/opt/freeware/lib
    root@test1:/root# curl -I test2:80
    HTTP/1.1 200 OK
    Date: Tue, 12 Mar 2019 14:24:14 GMT
    Server: Apache/1.3.31 (Unix)
    Content-Type: text/html

    You have to check rpm -qa if SSL installed from rpm command.

     

    2. If SSL version are lower, than you have to check this IBM Security bulletin :

    http://www-01.ibm.com/support/docview.wss?uid=isg3T1027517

     

    Hope that will help you.

     

    Best,

    AAB