python 'module' object has no attribute 'PROTOCOL_SSLv2'
PHP中文网
PHP中文网 2017-04-17 17:40:27
0
2
883

我的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中文网

认证0级讲师

Antworte allen(2)
伊谢尔伦

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的版本,好吧,这个问题算是比较隐蔽的

左手右手慢动作

@zwillon
。。False

Beliebte Tutorials
Mehr>
Neueste Downloads
Mehr>
Web-Effekte
Quellcode der Website
Website-Materialien
Frontend-Vorlage
Über uns Haftungsausschluss Sitemap
Chinesische PHP-Website:Online-PHP-Schulung für das Gemeinwohl,Helfen Sie PHP-Lernenden, sich schnell weiterzuentwickeln!