skip to Main Content

I have tried many ways of installing python3.7.6 on centos 7.

Regardless of what I do, I always get the error that the SSL module is not available.

I have tried basic install guides such as https://tecadmin.net/install-python-3-7-on-centos/
(short story: yum install openssl-devel, configure, make install)

One with manual/updated changes to the build files (https://joshspicer.com/python37-ssl-issue)

I’ve downloaded and built openssl myself, then tried to configure/build python with –with-openssl

No go.

Any other ideas?
If it were really this hard, no one would be using it, so I must have something special going on.

2

Answers


  1. Chosen as BEST ANSWER

    Ok, here's what finally worked for me.

    I think the key to success was updating LD_LIBRARY_PATH and PATH to include openssl as I went.

    Install and build openssl.

    OpenSSL 1.1.1d 10 Sep 2019

    cloned openssl repo

    Pulled out latest(?) 1.1 branch

    git checkout OpenSSL_1_1_1d -b 1_1_1d
    
    ./config --prefix=/opt/openssl
    make
    make install
    

    Add /opt/openssl/lib to your LD_LIBRARY_PATH env var

    Add /opt/openssl/bin to your PATH

    Install and build python-3.7.6

    I installed with --prefix=/opt/python-3.7.6

    ./configure --prefix=/opt/python-3.7.6  --enable-optimizations --with-openssl=/opt/openssl
    make
    make install
    

    Add /opt/python-3.7.6/lib to your LD_LIBRARY_PATH env var

    Add /opt/python-3.7.6/bin to your PATH

    Final Config

    LD_LIBRARY_PATH=/opt/openssl/lib:/opt/python-3.7.6/lib:

    PATH=/opt/openssl/bin:/opt/python-3.7.6/bin:/opt/idea/latest/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin


  2. seeing your post i decided to stop trying to install 3.7 (already half an hour of head banging) and went for 3.6 using IUS. however, when i checked the version i had just installed, i saw this:

    $ python3 -V

    Python 3.7.4

    so it looks like i got 3.7 even though this is the yum command i used:

    $ yum install python36

    anyway, it worked for me, perhaps it will work for you? a little bizarre, imo.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search