linux 平台使用pip安装python包,出现如下提示:
[dave@www.cndba.cn scripts]# pip install pymysql
Collecting pymysql
/usr/local/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:318: 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. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/security.html#snimissingwarning.
SNIMissingWarning
/usr/local/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:122: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/security.html#insecureplatformwarning.
InsecurePlatformWarning
Using cached PyMySQL-0.7.11-py2.py3-none-any.whl
Installing collected packages: pymysql
Successfully installed pymysql-0.7.11
[dave@www.cndba.cn scripts]#
解决方法:
首先安装 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就不会出现警告了
版权声明:本文为博主原创文章,未经博主允许不得转载。