美文网首页工作生活
解决pip安装出现sslerror的问题

解决pip安装出现sslerror的问题

作者: 狼无雨雪 | 来源:发表于2019-07-15 14:06 被阅读0次

错误代码如下

Collecting slwt
  Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None))
 after connection broken by 'SSLError(SSLError(1, u'[SSL: CERTIFICATE_VERIFY_FAI
LED] certificate verify failed (_ssl.c:661)'),)': /simple/slwt/
  Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None))
 after connection broken by 'SSLError(SSLError(1, u'[SSL: CERTIFICATE_VERIFY_FAI
LED] certificate verify failed (_ssl.c:661)'),)': /simple/slwt/
  Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None))
 after connection broken by 'SSLError(SSLError(1, u'[SSL: CERTIFICATE_VERIFY_FAI
LED] certificate verify failed (_ssl.c:661)'),)': /simple/slwt/
  Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None))
 after connection broken by 'SSLError(SSLError(1, u'[SSL: CERTIFICATE_VERIFY_FAI
LED] certificate verify failed (_ssl.c:661)'),)': /simple/slwt/
  Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None))
 after connection broken by 'SSLError(SSLError(1, u'[SSL: CERTIFICATE_VERIFY_FAI
LED] certificate verify failed (_ssl.c:661)'),)': /simple/slwt/
  Could not fetch URL https://pypi.org/simple/slwt/: There was a problem confirm
ing the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max ret
ries exceeded with url: /simple/slwt/ (Caused by SSLError(SSLError(1, u'[SSL: CE
RTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:661)'),)) - skipping
  Could not find a version that satisfies the requirement slwt (from versions: )

No matching distribution found for slwt

正确解决方法:

    pip install lightgbm -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
  • 其中lightgbm是想要安装的包

相关文章

网友评论

    本文标题:解决pip安装出现sslerror的问题

    本文链接:https://www.haomeiwen.com/subject/pzzdhctx.html