记一次python3 pip 报错Retrying

  • Post author:
  • Post category:python


错误信息如下

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/pandas/
  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/pandas/
  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/pandas/
  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/pandas/
  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/pandas/

网上有说换pip源的,有指定临时源的,有翻墙的,有网络问题的…数不胜数,最终还是通过

换源

解决

以阿里源为例,系统centos6.5

1.进入家目录$ cd

2.创建.pip文件夹$ mkdir .pip

3.切换到.pip目录下$ cd .pip

3.创建配置文件,内容如下: $ vim pip.conf

[global]
index-url=http://mirrors.aliyun.com/pypi/simple/

[install]
trusted-host=mirrors.aliyun.com

有个坑需要注意,如果python是root用户编译安装的,请在/root目录下创建.pip文件夹和pip.conf配置文件,如果切换到普通用户出现了Retrying的问题请把这个/root目录下的.pip文件夹拷到普通用户家目录下



版权声明:本文为zhouapples原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。