• centos解决Could not find a version that satisfies the requirement pip3 (from versions: none)及No matching distribution found for pip3问题


    python环境:python 3.8

    报错信息:

    WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
    Collecting pip3
      WARNING: 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/
      WARNING: 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/
      WARNING: 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/
      WARNING: 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/pip3/
      WARNING: Retrying (Retry(total=0, 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/
      Could not fetch URL https://pypi.org/simple/pip3/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pip3/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.")) - skipping
      ERROR: Could not find a version that satisfies the requirement pip3 (from versions: none)
    ERROR: No matching distribution found for pip3
    WARNING: 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

    安装python 3.8的方法:centos安装httprunner方法

    执行命令:

    #pip install httprunner

    报错:使用pip 命令失败,见顶部“报错信息”

    解决办法:升级openssl

    1、查看openssl版本

    # openssl version

    OpenSSL 1.0.1e-fips 11 Feb 2013

    # cat /etc/issue               
    CentOS release 6.6 (Final)
    Kernel on an m

    原因:系统版本centos6.6,其中openssl的版本为OpenSSL 1.0.1e-fips 11 Feb 2013,而python3.8需要的openssl的版本为1.0.2或者1.1.x,需要对openssl进行升级,并重新编译python3.8.0。

    注意:yum 安装的openssl 版本都比较低。
    2、下载openssl
    #wget https://www.openssl.org/source/openssl-1.1.1a.tar.gz
    #tar -zxvf openssl-1.1.1a.tar.gz
    #cd openssl-1.1.1a
    3、编译安装
    #./config --prefix=/usr/local/openssl no-zlib #不需要zlib
    #make && make install
    4、备份原配置
    #mv /usr/bin/openssl /usr/bin/openssl.bak
    #mv /usr/include/openssl/ /usr/include/openssl.bak
    5、新版配置
    #ln -s /usr/local/openssl/include/openssl /usr/include/openssl
    #ln -s /usr/local/openssl/lib/libssl.so.1.1 /usr/local/lib64/libssl.so
    #ln -s /usr/local/openssl/bin/openssl /usr/bin/openssl
    6、修改系统配置
    1)写入openssl库文件的搜索路径
    #echo "/usr/local/openssl/lib" >> /etc/ld.so.conf
    2)使修改后的/etc/ld.so.conf生效
    #ldconfig -v
    7、查看openssl版本

    # openssl version

    OpenSSL 1.1.1a  20 Nov 2018

    8、重新安装python

    进入python解压缩文件夹,执行
    #./configure --prefix=/usr/local/python3 --with-openssl=/usr/local/openssl
    #make
    #make install

    ------------------------------------------------------Tanwheey--------------------------------------------------

    爱生活,爱工作。





  • 相关阅读:
    BZOJ3514:GERALD07加强版(LCT,主席树)
    BZOJ2729:[HNOI2012]排队(组合数学)
    BZOJ4517:[SDOI2016]排列计数(组合数学,错排公式)
    BZOJ3123:[SDOI2013]森林(主席树,启发式合并)
    BZOJ3786:星系探索(Splay,括号序)
    BZOJ2212:[POI2011]Tree Rotations(线段树合并)
    BZOJ5329:[SDOI2018]战略游戏(圆方树,虚树)
    CF613D:Kingdom and its Cities(树形DP,虚树)
    BZOJ3611:[HEOI2014]大工程(树形DP,虚树)
    BZOJ2286:[SDOI2011]消耗战(树形DP,虚树)
  • 原文地址:https://www.cnblogs.com/Tanwheey/p/11995697.html
Copyright © 2020-2023  润新知