天天看点

Python 使用 scrapy shell 网站 进入命令窗口时候报错 AttributeError: module ‘lib‘ has no attribute

Python 使用 scrapy shell 网站 进入命令窗口时候报错

问题描述——AttributeError: module ‘lib’ has no attribute ‘X509_V_FLAG_CB_ISSUER_CHECK’‘action’ 不是内部或外部命令,也不是可运行的程序或批处理文件。

Python 使用 scrapy shell 网站 进入命令窗口时候报错 AttributeError: module ‘lib‘ has no attribute

问题原因

错误分析:主要原因是系统当前的python和pyOpenSSL版本不对应

解决方法

卸载再重装pyOpenSSL

pip uninstall pyOpenSSL
pip install pyOpenSSL      
Python 使用 scrapy shell 网站 进入命令窗口时候报错 AttributeError: module ‘lib‘ has no attribute
Python 使用 scrapy shell 网站 进入命令窗口时候报错 AttributeError: module ‘lib‘ has no attribute

安装后面使用 scrapy shell 网址 命令 后面还是报错了

报错信息“

AttributeError: module 'OpenSSL.SSL' has no attribute 'SSLv3_METHOD'      
Python 使用 scrapy shell 网站 进入命令窗口时候报错 AttributeError: module ‘lib‘ has no attribute

发现还是 pyOpenSSL 版本问题

测试

测试一下scrapy这个模块版本信息”

输入命令

scrapy version --verbose      
Python 使用 scrapy shell 网站 进入命令窗口时候报错 AttributeError: module ‘lib‘ has no attribute

这个上面是更改后的,为了让scrapy shell 网址 这个命令运行成功不报错

我安装了scrapy 2.5.1 和pyOpenSSL==22.0.0 这个版本

安装命令如下:

pip install pyOpenSSL==22.0.0
pip install scrapy==2.5.1      
Python 使用 scrapy shell 网站 进入命令窗口时候报错 AttributeError: module ‘lib‘ has no attribute
Python 使用 scrapy shell 网站 进入命令窗口时候报错 AttributeError: module ‘lib‘ has no attribute
上一篇: C++ 墙角知识
下一篇: HBase 实践