AttributeError: module ‘OpenSSL.SSL‘ has no attribute ‘SSLv3_METHOD‘

问题场景:在scrapy框架下添加爬虫脚本,运行时出现报错:

AttributeError: module 'OpenSSL.SSL' has no attribute 'SSLv3_METHOD'

解决方法: 



#卸载cryptography
pip uninstall cryptography

#重新安装cryptography 36.0.2
pip install cryptography==36.0.2 -i http://pypi.douban.com/simple --trusted-host pypi.douban.com

#卸载pyOpenSSL
pip uninstall pyOpenSSL

#重新安装pyOpenSSL 22.0.0
pip install pyOpenSSL==22.0.0 -i http://pypi.douban.com/simple --trusted-host pypi.douban.com  

你可能感兴趣的:(ssl,python)