linux下安装scrapy遇到的问题--Is libxml2 installed?解决方法

在腾讯云CentOS7环境下使用Python3安装Scrapy时遇到错误,通过安装lxml库确认问题可能出在lxml上。尝试单独安装lxml后,错误依旧。通过查阅资料,发现需要安装`python3-dev libxslt-devel libxml2-devel`三个依赖,安装完成后问题解决。最后进行了软链接设置。
摘要由CSDN通过智能技术生成

当前环境:tencent 云主机centos7,python3

按照scrapy文档,直接pip3 install scrapy

error: command 'gcc' failed with exit status 1
*********************************************************************************
Could not find function xmlCheckVersion in library libxml2. Is libxml2 installed?
*********************************************************************************

大致猜测一下估计是lxml这个库出现了问题,于是,单独安装一下lxml

pip3 install lxml,

果然出现了一模一样的错误。

    building 'lxml.etree' extension
    creating build/temp.linux-x86_64-3.5
    creating build/temp.linux-x86_64-3.5/src
    creating build/temp.linux-x86_64-3.5/src/lxml
    gcc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DCYTHON_CLINE_IN_TRACEBACK=0 -Isrc -Isrc/lxml/includes -I/usr/local/python3/include/python3.5m -c src/lxml/etree.c -o build/temp.linux-x86_64-3.5/src/lxml/etree.o -w
    In file included from src/lxml/etree.c:687:0:
    src/lxml/includes/etree_defs.h:14:31: fatal error: libxml/xmlversion.h: No such file or directory
     #include "libxml/xmlversion.h"
                                   ^
    compilation terminated.
    Compile failed: command 'gcc' failed with exit status 1
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值