安装scrapy2.5版本之后运行代码可能会遇到以下错误:

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

为什么会报这个错误呢? 查看官方文档:https://pypi.org/project/pyOpenSSL/ 发现在22.0.0版本以后就不再支持SSLv2 和 SSLv3

解决办法降低版本:pip install pyOpenSSL==22.0.0

在降低pyOpenSSL版本后仍报以下错误 原因仍然是cryptography版本太高,在38.0.4版本以后,不支持OpenSSL 。 官方更新日志文档:https://cryptography.io/en/latest/changelog/

AttributeError: module 'lib' has no attribute 'OpenSSL_add_all_algorithms'

降低cryptography版本:pip install cryptography==38.0.4

完成以上两步以后scrapy就可以正常执行代码了。

文章链接

评论可见,请评论后查看内容,谢谢!!!
 您阅读本篇文章共花了: