签到成功

知道了

CNDBA社区CNDBA社区

Python A true SSLContext object is not available 警告解决方法

2017-11-15 13:28 7576 0 原创 Python
作者: dave

linux 平台使用pip安装python包,出现如下提示:http://www.cndba.cn/dave/article/2319

http://www.cndba.cn/dave/article/2319

    [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]#

解决方法:http://www.cndba.cn/dave/article/2319http://www.cndba.cn/dave/article/2319http://www.cndba.cn/dave/article/2319

http://www.cndba.cn/dave/article/2319
http://www.cndba.cn/dave/article/2319

首先安装 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就不会出现警告了

http://www.cndba.cn/dave/article/2319
http://www.cndba.cn/dave/article/2319
http://www.cndba.cn/dave/article/2319

版权声明:本文为博主原创文章,未经博主允许不得转载。

用户评论
* 以下用户言论只代表其个人观点,不代表CNDBA社区的观点或立场
dave

dave

关注

人的一生应该是这样度过的:当他回首往事的时候,他不会因为虚度年华而悔恨,也不会因为碌碌无为而羞耻;这样,在临死的时候,他就能够说:“我的整个生命和全部精力,都已经献给世界上最壮丽的事业....."

  • 2261
    原创
  • 3
    翻译
  • 578
    转载
  • 191
    评论
  • 访问:7968271次
  • 积分:4346
  • 等级:核心会员
  • 排名:第1名
精华文章
    最新问题
    查看更多+
    热门文章
      热门用户
      推荐用户
        Copyright © 2016 All Rights Reserved. Powered by CNDBA · 皖ICP备2022006297号-1·

        QQ交流群

        注册联系QQ