pip安装模块警告InsecurePlatformWarning: A true SSLContext object is not available.

http://blog.csdn.net/henulwj/article/details/48131393/

在用pip7.1.2版本安装第三方模块时出现了如下警告:

<code class="hljs avrasm has-numbering">/usr/lib/python2<span class="hljs-number">.7</span>/site-packages/pip-<span class="hljs-number">7.1</span><span class="hljs-number">.2</span>-py2<span class="hljs-number">.7</span><span class="hljs-preprocessor">.egg</span>/pip/_vendor/requests/packages/urllib3/util/ssl_<span class="hljs-preprocessor">.py</span>:<span class="hljs-number">90</span>: 
<span class="hljs-label">InsecurePlatformWarning:</span> A true SSLContext object is not available. 
This prevents urllib3 from configuring SSL appropriately <span class="hljs-keyword">and</span> may 
cause certain SSL connections to fail. For more information, see 
<span class="hljs-label">https:</span>//urllib3<span class="hljs-preprocessor">.readthedocs</span><span class="hljs-preprocessor">.org</span>/en/latest/security<span class="hljs-preprocessor">.html</span><span class="hljs-preprocessor">#insecureplatformwarning.</span></code><ul style="display: block;" class="pre-numbering"><li>1</li><li>2</li><li>3</li><li>4</li><li>5</li></ul>

提示是由于urllib3的SSL连接失败

解决方法

首先安装python-devel libffi-devel openssl-devel

yum install python-devel libffi-devel openssl-devel

之后在安装pyopenssl ndg-httpsclient pyasn1

pip install pyopenssl ndg-httpsclient pyasn1

在运行pip就不会出现警告了


你可能感兴趣的:(pip安装模块警告InsecurePlatformWarning: A true SSLContext object is not available.)