解决 ‘Could not fetch URL https://pypi.org’的问题

Mac上安装了python2和python3,使用pip为python3安装bs4报错:

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(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1123)'))) - skipping

使用下面安装方式解决:

python3 -m pip install bs4 --trusted-host=pypi.python.org --trusted-host=pypi.org --trusted-host=files.pythonhosted.org

你可能感兴趣的:(python)