目录
问题描述
临时解决方法
永久生效方法
问题描述
pip install virtualenvCollecting virtualenv/opt/python27/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:315: SNIMissingWarning: An HTTPS request has been made, but the SNI (Subject Name Indication) extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS certificate, which can cause validation failures. For more information, see /en/latest/security.html#snimissingwarning.SNIMissingWarningCould not fetch URL /simple/virtualenv/: There was a problem confirming the ssl certificate: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:590) - skippingCould not find a version that satisfies the requirement virtualenv (from versions: )
临时解决方法
使用–trusted-host命令行选项
pip --trusted-host install virtualenv
安装其他库的时候只要出现类似错误 均可以使用此方法
永久生效方法
在 $HOME/.pip/pip.conf 中加入trusted-host选项,该方法是一劳永逸
[global]index-url = /pypi/simple/[install]trusted-host=