gpt4 book ai didi

python - ssl 'module' 对象没有属性 'SSLContext'

转载 作者:IT老高 更新时间:2023-10-28 20:45:38 26 4
gpt4 key购买 nike

In [1]: import ssl

In [2]: context = ssl.SSLContext(ssl.PROTOCOL_TLSv1_2)

AttributeError Traceback (most recent call last)
<ipython-input-2-13c9bad66150> in <module>()
----> 1 context = ssl.SSLContext(ssl.PROTOCOL_TLSv1_2)

AttributeError: 'module' object has no attribute 'SSLContext'

Python 版本:2.7.6

最佳答案

SSLContext 是在 2.7.9 中引入的,你使用的是旧版本的 Python,所以它没有这个属性。

关于python - ssl 'module' 对象没有属性 'SSLContext',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28228214/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com