CentOS7安装scrapy

本文详细介绍了在Python环境中安装Scrapy爬虫框架的过程,并针对安装过程中可能遇到的几个典型问题提供了具体的解决方案。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

安装好Python 2.7 and Python 3.3 or above的前提上。官网:https://scrapy.org/  
1、wget https://bootstrap.pypa.io/get-pip.py  
2、sudo python2.7 get-pip.py
3、sudo pip install virtualenv
4、pip install scrapy


问题一、
步骤四报错:Python.h No such file or directory
解决:sudo yum install python-devel.x86_64


问题二、
输入scrapy命令报错 (搜索 http://stackoverflow.com/  )
AttributeError: 'module' object has no attribute 'OP_NO_TLSv1_1'

解决:sudo pip install Twisted==16.4.1 

原因:

Twisted dropped support for pyOpenSSL < 16.0.0 in Twisted 16.4.0 release (seehttp://twistedmatrix.com/trac/ticket/8441); in fact it worked for some time, but they recently removed some of the supporting code as well. Is upgrading it an option? You can check pyOpenSSL version by running

问题三、
pip list 报如下警告:
DEPRECATION: The default format will switch to columns in the future. You can use --format=(legacy|columns) (or define a format=(legacy|columns) in your pip.conf under the [list] section) to disable this warning.

解决:pip list --format=columns 

总结:1、安装软件时,应先参考官方网站。通过百度等搜索的结果比较杂,还得花时间刷选,最后有可能由于软件的配置不同及其它因素,导致安装失败。


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值