Home  >  Q&A  >  body text

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 days ago889

reply all(2)I'll reply

  • 伊谢尔伦

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

    update:
    I just tried it. The default SSL packaged in ubuntu 14.04 is the V3 version, so there is a compatibility issue. It may be a new version packaged by Ubuntu to solve some bugs in openssl. This is different from the current Redhat version. The series or the default version of Windows around 2.7.10 is still a little different. If you want to solve it, you need to compile the openssl v2 version into python yourself, or see if there is a compiled version of sslv2 and use it directly on windows
    Version 2.7.10, Fedora 23, and Redhat 6.4 all use the SSLv2 version by default. Well, this problem is relatively hidden

    reply
    0
  • ringa_lee

    ringa_lee2017-04-17 17:42:27

    @zwillon
    。。False

    reply
    0
  • Cancelreply