• python3.7.2 pip 出现locations that require TLS/SSL异常处理方法


    centos7安装python3.7.2后,运行

    pip3 install tornado

    会报错

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

    解决方法:

    在./configure过程中,如果没有加上–with-ssl参数时,默认安装的软件涉及到ssl的功能不可用,
    刚好pip3过程需要ssl模块,而由于没有指定,所以该功能不可用。

    1. 查看openssl安装包,发现缺少openssl-devel包 

      [root@localhost ~]# rpm -aq|grep openssl 
      openssl-0.9.8e-20.el5 
      openssl-0.9.8e-20.el5 
      [root@localhost ~]#
    2. yum安装openssl-devel 

      [root@localhost ~]# yum install openssl-devel -y 


      查看安装结果 

      [root@localhost ~]# rpm -aq|grep openssl 
      openssl-0.9.8e-26.el5_9.1 
      openssl-0.9.8e-26.el5_9.1 
      openssl-devel-0.9.8e-26.el5_9.1 
      openssl-devel-0.9.8e-26.el5_9.1
    3. 重新对python3.7.2进行编译安装,用以下过程来实现编译安装

      cd Python-3.7.2
      ./configure --with-ssl
      make
      sudo make install

    参考:

    https://blog.csdn.net/zhengcaihua0/article/details/79681991

  • 相关阅读:
    ubuntu 如何进行文件、夹删除等操作
    cuda cudnn anaconda gcc tensorflow 安装及环境配置
    ubuntu16.04系统gcc下降和升级
    关于AJAX 第五篇
    关于AJAX 第四篇
    关于AJAX 第三篇
    关于AJAX 第二篇
    关于AJAX 第一篇
    (转)关于区块链与比特币 来源于嘶吼: http://www.4hou.com/info/news/6152.html
    php 函数
  • 原文地址:https://www.cnblogs.com/sea-stream/p/10390441.html
Copyright © 2020-2023  润新知