linux系统安装scapy,CentOS 7 下安装Scrapy

由于CentOS6下需要升级python版本,这里简单起见直接使用CentOS7 ,默认CentOS7使用的python包管理器是easy_install ---当然也可以通过easy_install安装pip。所以使用如下命令搞定scrapy的安装:

easy_install scrapy

不过安装过程可能不会像上面那么顺利,就为其还依赖一些rpm包,所以在安装前需要安装如下包:

yum install libxslt-devel libffi libffi-devel python-devel gcc openssl openssl-devel

如果不事先安装以上包,可能会遇到如下的相关报错和问题

报错1:

ERROR: /bin/sh: xslt-config: command not found

* make sure the development packages of libxml2 and libxslt are installed *

解决方法yum -y install libxslt-devel 。

报错2:

Using build configuration of libxslt 1.1.28

Building against libxml2/libxslt in the following directory: /usr/lib64

src/lxml/lxml.etree.c:85:20: fatal error: Python.h: No such file or directory

#include “Python.h”

^

compilation terminated.

Compile failed: command ‘gcc’ failed with exit status 1

error: Setup script exited with error: command ‘gcc’ failed with exit status 1

缺少python-devel包,因为Python.h文件是在python-devel包中的。直接yum安装该包即可。

报错3:

removing: _configtest.c _configtest.o

c/_cffi_backend.c:13:17: fatal error: ffi.h: No such file or directory

include ffi.h

compilation terminated.

error: Setup script exited with error: command ‘gcc’ failed with exit status

centos下的报错示还是很好的,yum list|grep ffi相关的包,发现执行如下安装yum -y install libffi libffi-devel 。

0b1331709591d260c1c78e86d0c51c18.png

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值