Linux上运行scrapy命令报错
今天把一个scrapy项目放到服务器上,各种依赖包也都装好了.
运行scrapy命令提示错误:
AttributeError: module 'lib' has no attribute 'OpenSSL_add_all_algorithms'
就去网上查了下,应该是缺少OpenSSL库或者OpenSSL库版本不兼容所导致的。
1.安装OpenSSL库
- Ubuntu/Debian: sudo apt-get install libssl-dev
- CentOS/RHEL: yum install openssl-devel
- macOS: brew install openssl
2.根据报错信息安装对应的库
# ImportError: cannot import name 'SSLv3_METHOD' from 'OpenSSL.SSL'
pip3 install pyopenssl==22.0.0
# AttributeError: module 'lib' has no attribute 'OpenSSL_add_all_algorithms'
pip3 install cryptography==38.0.4
安装完成后在运行scrapy就行了。
参考教程:点击查看
如果文章对你有帮助!可点击按钮打赏哦 ~
发表评论
共 0 条评论
暂无评论