zoukankan      html  css  js  c++  java
  • Can't connect to HTTPS URL because the SSL module is not available.

    今天用pip3安装第三方库的时候报了这样一个错:

      Can't connect to HTTPS URL because the SSL module is not available. - skipping

    [root@python_test ~]# rpm -qa openssl  # 检查了一下是安装了openssl的
    openssl-1.0.1e-57.el6.x86_64

    于是我将原先编译安装好的python目录删除后,重新编译安装:

    [root@python_test tools]# tar xf Python-3.6.3.tgz
    [root@python_test Python-3.6.3]# ./configure --prefix=/usr/local/python3.6.3 --with-ssl    # pip3会用到ssl模块,之前没有指定所以该功能不能使用
    [root@python_test Python-3.6.3]# make && make install

    最后测试发现已经可以了:

    [root@pygame ~]# pip3 install pygame
    Collecting pygame
      Retrying (Retry(total=4, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError('<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7fb129etRyf5a20>: Failed to establish a new connection: [Errno -2] Name or service not known',)': /simple/pygame/
      Retrying (Retry(total=4, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError('<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7fb129fWER12128>: Failed to establish a new connection: [Errno -2] Name or service not known',)': /simple/pygame/
      Retrying (Retry(total=3, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError('<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7fb129ef5WER5c0>: Failed to establish a new connection: [Errno 110] Connection timed out',)': /simple/pygame/
      Retrying (Retry(total=4, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError('<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7fb129eaEWR9cf8>: Failed to establish a new connection: [Errno -2] Name or service not known',)': /packages/b3/5e/fb7c85304ad1fd52008fd25fce97a7f59e6147ae97378afc86cf0f5d9146/pygame-1.9.4-cp36-cp36m-manylinux1_x86_64.whl
      Downloading https://files.pythonhosted.org/packages/b3/5e/fb7c85304ad1fd52008fd25fce97a7f59e6147ae97378afc86cf0f5d9146/pygame-1.9.4-cp36-cp36m-manylinux1_x86_64.whl (12.1MB)
        100% |████████████████████████████████| 12.1MB 61kB/s 
    Installing collected packages: pygame
    Successfully installed pygame-1.9.4

     然后测试一下ssl模块是否可用:

    [root@python_test ~]# python3
    Python 3.6.3 (default, Dec 27 2018, 05:50:10) 
    [GCC 4.4.7 20120313 (Red Hat 4.4.7-23)] on linux
    Type "help", "copyright", "credits" or "license" for more information.
    >>> 
    >>> import ssl    # 没报错说明可以用了
    >>> 
  • 相关阅读:
    SQL语法:查询此表有另外一个表没有的数据
    .NET平台开源项目速览-最快的对象映射组件Tiny Mapper之项目实践
    win7 64 安装Oracle 11G 、使用PLSQL进行连接 标准实践
    json 筛选数据 $.grep过滤数据
    bootstrap table 行号 显示行号 添加行号 bootstrap-table 行号
    ajax 请求二进制流 图片 文件 XMLHttpRequest 请求并处理二进制流数据 之最佳实践
    JS中判断JSON数据是否存在某字段的方法 JavaScript中判断json中是否有某个字段
    json 数字key json 数字作为主键
    ajax 跨域 headers JavaScript ajax 跨域请求 +设置headers 实践
    扩展:gridview 空数据时显示表头
  • 原文地址:https://www.cnblogs.com/zhangweiyi/p/10614658.html
Copyright © 2011-2022 走看看