由于ssl问题,在Windows中的Pip安装不起作用

时间:2018-04-19 04:27:14

标签: python pip

我正在尝试<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <li class="sidebar-collapse"> <a href="class.php"> <i class="fa fa-sitemap"></i> Class<span class="fa arrow"></span> </a> <ul class="nav nav-second-level" style="display:none"> <li class="active-menu"> <a href="class.php">Class</a> </li> <li> <a href="Section.php">Section</a> </li> </ul> </li>在我的计算机上安装tensorflow。我支持公司代理,我绕过SSL证书,所以通常我会使用这个命令

pip install

它通常运行良好,但就在今天pip --proxy 0.0.0.0:80 --trusted-host pypi.python.org install tensorflow不断向我抛出SSL证书错误:

pip install

我尝试使用curl并且有效:

Collecting tensorflow Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:749)'),)': /simple/tensorflow/ Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:749)'),)': /simple/tensorflow/ Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:749)'),)': /simple/tensorflow/ Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:749)'),)': /simple/tensorflow/ Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:749)'),)': /simple/tensorflow/ Could not fetch URL https://pypi.python.org/simple/tensorflow/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.python.org', port=443): Max retries exceeded with url: /simple/tensorflow/ (Caused by SSLError(SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:749)'),)) - skipping Could not find a version that satisfies the requirement tensorflow (from versions: ) No matching distribution found for tensorflow

如何卷曲有效但是pip没有?以及如何使用pip使其工作?

我的环境:

curl -x 0.0.0.0:80 -k -L https://pypi.python.org

1 个答案:

答案 0 :(得分:0)

要使pip适合安装,您需要使用pip安装curl

curl https://bootstrap.pypa.io/get-pip.py | python

原因是Python.org网站已停止支持旧版本的TLS,因此您现在需要更高版本的pip。有关详细信息,请参阅此answer