Heim  >  Fragen und Antworten  >  Hauptteil

python 'module' object has no attribute 'PROTOCOL_SSLv2'

我的python版本是python2.7.6 系统是ubuntu 14.04.1
进入交互式写入import ssl是不会报错的.

但是执行py文件就报一下错误了
File "/root/py/ssl.py", line 4, in <module>

'SSLv2':ssl.PROTOCOL_SSLv2,

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

所有包含有 import ssl模块的文件都报这错误,望解答!

PHP中文网PHP中文网2742 Tage vor885

Antworte allen(2)Ich werde antworten

  • 伊谢尔伦

    伊谢尔伦2017-04-17 17:42:27

    update:
    刚试了下,默认的ubuntu 14.04里打包用的SSL是V3版本的,所以有兼容性问题,可能是Ubuntu为了解决openssl的某些bug而打包的新版本,这个跟目前的Redhat系列或默认的windows的2.7.10左右的版本还是有些不一样的,你要解决的话,需要自己编译openssl v2的版本到python里, 或者看下有没有编译好的sslv2的版本直接用
    windows上的2.7.10的版本、Fedora 23、 Redhat 6.4都默认用的是SSLv2的版本,好吧,这个问题算是比较隐蔽的

    Antwort
    0
  • ringa_lee

    ringa_lee2017-04-17 17:42:27

    @zwillon
    。。False

    Antwort
    0
  • StornierenAntwort