[Python] CentOs7: ssl module in Python is not available

Discussão em 'Python' iniciado por Stack, Agosto 5, 2025.

  1. Stack

    Stack Membro Participativo

    I am on CentOS Linux release 7.9.2009 (Core), installed python3.10.12 from source using the following script

    sudo yum update

    sudo yum groupinstall "Development Tools"
    sudo yum install zlib-devel bzip2-devel \
    openssl-devel ncurses-devel sqlite-devel \
    readline-devel tk-devel gdbm-devel \
    libffi-devel xz-devel


    wget https://www.python.org/ftp/python/3.10.12/Python-3.10.12.tgz


    tar -xvf Python-3.10.12.tgz

    ./configure --enable-optimizations

    make

    sudo make altinstall


    Python 3.10.12 (main, Jul 8 2023, 16:54:43) [GCC 4.8.5 20150623 (Red Hat 4.8.5-44)] on linux
    Type "help", "copyright", "credits" or "license" for more information


    sudo ln -s /usr/local/bin/python3.10 /usr/local/bin/python3


    But, when trying pip, I got this error

    There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/tutor/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.")) - skipping


    Tried to list the ssl modules installed for python3, and got this [​IMG]

    Also, when trying

    python3.10 -m ssl


    I got

    ModuleNotFoundError: No module named '_ssl'


    I found some answer that suggests adding --with-ssl option while building, and another answer that deosn't use this option at all. How can I solve this?

    Continue reading...

Compartilhe esta Página