pip error while installing Python: “Ignoring ensurepip failure: pip 8.1.1 requires SSL/TLS”

后端 未结 8 2006
礼貌的吻别
礼貌的吻别 2020-12-14 00:34

I downloaded the Python 3.5 source code and ran the following:

$ tar -xf Python-3.5.2.tar.xz
$ ./configure --with-ensurepip=upgrade
$ make
$ sudo make altins         


        
相关标签:
8条回答
  • 2020-12-14 01:01

    On Ubuntu 18.04 only this worked for me

    sudo apt-get install libssl1.0
    
    0 讨论(0)
  • 2020-12-14 01:05

    If you are using RedHat Enterprise Linux, you can use this:

    yum install openssl-devel -y
    
    0 讨论(0)
  • 2020-12-14 01:06

    CentOS:

    If you didn't have openssl-devel at the time of installing python, pip 8.1.1 won't install. After installing openssl-devel, reinstall python. This time it should install pip just file.

    0 讨论(0)
  • 2020-12-14 01:13

    You are most likely not compiling Python with SSL/TLS support - this is likely because you don't have the SSL development dependencies installed on your system.

    Install the following dependency, and then re-configure and re-compile Python 3.5.

    Ubuntu

    apt-get install libssl-dev
    

    In addition it is recommended to install the following.

    apt-get install make build-essential libssl-dev zlib1g-dev libbz2-dev libsqlite3-dev
    

    CentOS

    yum install openssl-devel
    

    In addition it is recommended to install the following.

    yum install zlib-devel bzip2-devel sqlite sqlite-devel openssl-devel
    
    0 讨论(0)
  • 2020-12-14 01:15

    CentOS or RHEL machine Python3(3.7.0) ssl not supported as of now.

    pip installation supported with Python <=3.6

    0 讨论(0)
  • 2020-12-14 01:18

    I tried to install Python 3.4.10 using asdf but got following error:

    $ asdf install python 3.4.10
    python-build 3.4.10 /home/br0ke/.asdf/installs/python/3.4.10
    Downloading Python-3.4.10.tar.xz...
    -> https://www.python.org/ftp/python/3.4.10/Python-3.4.10.tar.xz
    Installing Python-3.4.10...
    ERROR: The Python ssl extension was not compiled. Missing the OpenSSL lib?
    
    Please consult to the Wiki page to fix the problem.
    https://github.com/pyenv/pyenv/wiki/Common-build-problems
    
    
    BUILD FAILED (Fedora 30 using python-build 1.2.15-2-g22c02022)
    
    Inspect or clean up the working tree at /tmp/python-build.20191121110112.9959
    Results logged to /tmp/python-build.20191121110112.9959.log
    
    Last 10 log lines:
    (cd /home/br0ke/.asdf/installs/python/3.4.10/share/man/man1; ln -s python3.4.1 python3.1)
    if test "xupgrade" != "xno"  ; then \
        case upgrade in \
            upgrade) ensurepip="--upgrade" ;; \
            install|*) ensurepip="" ;; \
        esac; \
         ./python -E -m ensurepip \
            $ensurepip --root=/ ; \
    fi
    Ignoring ensurepip failure: pip 9.0.1 requires SSL/TLS
    

    It may mean that I have too fresh OpenSSL version installed in my system and this version is not supported by Python I'm trying to build. I managed to install Python 3.4.10 on my Fedora 30 machine (has OpenSSL 1.1+ by default) using the following steps:

    1. Temporary remove openssl-devel if it is installed as it will conflict with older version:
    $ sudo dnf remove openssl-devel
    
    1. Install compat OpenSSL 1.0 packages:
    $ sudo dnf install compat-openssl10 compat-openssl10-devel
    
    1. Build Python 3.4.10 (I use asdf but it should work with pyenv as well):
    $ asdf install python 3.4.10
    
    1. Remove compat library and install modern instead to be able to build something more fresh next time:
    $ sudo dnf remove compat-openssl10-devel
    $ sudo dnf install openssl-devel
    

    Inspired by this workaround with help from Fedora community people.

    0 讨论(0)
提交回复
热议问题