解决pip安装出现sslerror的问题

错误代码如下

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是想要安装的包

猜你喜欢

转载自blog.csdn.net/chr1341901410/article/details/80995451
今日推荐