我该如何修复这个警告“SNIMissingWarning”?

我该如何修复这个警告“SNIMissingWarning”?

因此,我尝试使用一个名为 awslogs 的 Python 程序来查询不同的日志流。当我调用

sudo awslogs get /aws/lambda/<my lambda> Process ALL --start='5 day'

我收到警告

SNIMissingWarning: An HTTPS request has been made, but the SNI (Server 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/advanced-usage.html#ssl-warnings

在网上阅读并根据错误本身,解决方案是升级我的python。 我的Python版本是2.7.6。

因此我尝试使用这些命令升级 python。

sudo add-apt-repository ppa:jonathonf/python-2.7

sudo apt-get update

sudo apt-get install python2.7

python --version

但是当我跑步时

sudo add-apt-repository ppa:jonathonf/python-2.7

我收到此错误消息

Traceback (most recent call last):
  File "/usr/bin/add-apt-repository", line 11, in <module>
    from softwareproperties.SoftwareProperties import SoftwareProperties, shortcut_handler
  File "/usr/lib/python3/dist-packages/softwareproperties/SoftwareProperties.py", line 27, in <module>
    import apt_pkg
ModuleNotFoundError: No module named 'apt_pkg'

我无法通过在线查找到的方法来解决这个问题,所以我在这里发布了这个问题。

输出readlink -f /usr/bin/python3

/usr/bin/python3.6

相关内容