在安装pip3 install virtualenv时报了SSL异常

如图

pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
Collecting virtualenv
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/virtualenv/
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/virtualenv/
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/virtualenv/
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/virtualenv/
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/virtualenv/
Could not fetch URL https://pypi.org/simple/virtualenv/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/virtualenv/ (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 virtualenv (from versions: )
No matching distribution found for virtualenv
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模块,而由于没有指定,所以该功能不可用。

解決办法,安装 openssl-devel:yum -y install openssl-devel

再次安装,还是报错

重新编译python,到准备的python的安装包目录

[root@localhost Python-3.7.0]# ./configure --with-ssl

[root@localhost Python-3.7.0]# make && make install

再次执行安装:pip3 install virtualenv

timeout异常

pip._vendor.urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Read timed out.

在下载python库的时候,由于国内网络原因,python包的下载速度非常慢,查看pip 文档,只要在 pip的时候控制超时即可, 具体参数为 --default-timeout=100, 后面的时间可以自己指定。

pip install 报SSL异常和timeout异常的更多相关文章

  1. pip install报错Can't roll back cryptography; was not uninstalled

    当使用pip install或者pip install --upgrade报错 Can't roll back cryptography; was not uninstalled 可以进行以下的尝试: ...

  2. python pip install 报错TypeError: unsupported operand type(s) for -=: 'Retry' and 'int' Command "python setup.py egg_info" failed with error code 1 in

    pip install http://download.pytorch.org/whl/cu80/torch-0.2.0.post3-cp27-cp27mu-manylinux1_x86_64.whl ...

  3. pip install 报错 TypeError: 'module' object is not callable

    $ pip install filetype Traceback (most recent call last): File "/usr/local/bin/pip2", line ...

  4. pip install 报错原因

    1. 要在~/.pip/pip.conf中添加源的地址. 2. 在运行pip install 命令的时候加上sudo -H

  5. pip install 报错

    问题描述,在使用pip安装django相关软件包时,提示错误如下: [root@test4 install]# pip install django==1.6 Downloading/unpackin ...

  6. pip install报错:RuntimeError: Python version >= 3.5 required

    由于pip官方的不作为,现如今python2(以及某些低版本python3)配套的pip,已经没法正常的安装pypi包了. 例如需要用到的一套PyCaffe的代码,是基于Python2的,于是用min ...

  7. pip install 报错 Could not fetch URL

    Could not fetch URL https://pypi.python.org/simple/xxx/: There was a problem confirming the ssl cert ...

  8. 【Linux】CentOS6上安装Python3.7(config、make、make install)及“No module named '_ctypes'”/pip install时“ssl module in Python is not available.”的解决

    1.下载安装包 https://www.python.org/ftp/python/ 该目录下选择所需要的版本进行下载.解压. wget https://www.python.org/ftp/pyth ...

  9. pip install 报错UnicodeDecodeError: 'ascii' codec can't decode byte

    2017-03-23 报错原因: pip安装Python包会加载我的用户目录,我的用户目录恰好是中文的,ascii不能编码. 解决办法: python目录 Python27\Lib\site-pack ...

随机推荐

  1. 排序算法三:堆排序(Heapsort)

    堆排序(Heapsort)是一种利用数据结构中的堆进行排序的算法,分为构建初始堆,减小堆的元素个数,调整堆共3步. (一)算法实现 protected void sort(int[] toSort) ...

  2. 身份证验证的js

    function isIdCardNo(num) { num = num.toUpperCase(); //身份证号码为15位或者18位,15位时全为数字,18位前17位为数字,最后一位是校验位,可能 ...

  3. mpvue中的平台状态判断(H5网页 or 小程序)

    在开发微信小程序或者微信网页H5的时候,有时我们利用外部组件可能不兼容这两者,需要区分开来,可以在对应的mainjs中配置如下 let platform: try{ if(wx){ platform= ...

  4. Center OS 7

    1:关闭防火墙 systemctl stop iptables.service 2:禁止开启启动 systemctl disable firewalld.service 3:查看防火墙 firewal ...

  5. Go 使用切片

    1.使用切片字面量来声明切片 // 创建一个整型切片 // 其容量和长度都是 5 个元素 slice := [], , , , } // 改变索引为 1 的元素的值 slice[] = 2.使用切片创 ...

  6. ARC093F Dark Horse 容斥原理+DP

    题目传送门 https://atcoder.jp/contests/arc093/tasks/arc093_d 题解 由于不论 \(1\) 在哪个位置,一轮轮下来,基本上过程都是相似的,所以不妨假设 ...

  7. 前端BFC布局学习

    BFC,全称为(Block formatting context).按照我的理解是我们在某一条件下会触发BFC布局,会产生一定的效果. Block Formatting Contexts翻译为:块级元 ...

  8. C#高级编程笔记(11至16章)异步/托管/反射/异常

    11.1.2LINQ语句 LINQ查询表达式以from子句开始,以select或者group子句结束.在这两个子句之间可以跟零个或者多个from.let.where.join或者orderby子句. ...

  9. boost exception

    boost exception provides a new exception type, that lets you add data to an exception after it has b ...

  10. 英语单词delimiter

    delimiter 来源——命令参数 [root@centos7 ~]# cat /good/passwd root:x:::root:/root:/bin/bash bin:x:::bin:/bin ...