在搭建scrapy爬虫框架时,通过pip安装lxml遇到了这个问题,我是用32位的windows搭建爬虫框架,python版本是2.7.12, 解决方案如下:

  原因:  

  在网上各种找原因,有大神是说没安装libxml2-devel and libxslt-devel,和没有安装 libxml2和 libxslt文件。其实报错原因中也说明了没有安装好 libxml2

  各种解决方案,但是找了很久,试了很多种方法,最终我就参考了

    http://coding.derkeiler.com/Archive/Python/comp.lang.python/2012-11/msg00520.html     

    http://www.lfd.uci.edu/~gohlke/pythonlibs/#lxml(很多python依赖的库资源下载)

    http://jingyan.baidu.com/article/cbcede07177b8702f40b4df9.html

在windows操作系统下:

    1、安装wheel,在cmd中输入:pip install wheel

    2、下载依赖库,可以在http://www.lfd.uci.edu/~gohlke/pythonlibs/#lxml中下载 

      lxml-3.6.4-cp27-cp27m-win32.whl(python2.7版本,适用于windows32位系统)

      lxml-3.6.4-cp27-cp27m-win_amd64.whl(python2.7版本,适用于windows64位系统

      然后,把下载好的依赖文件放在python的安装包中,我的是放在F:\python2.7.12中

    3、开始安装lxml

        pip install F:\python2.7.12\lxml-3.6.4-cp27-cp27m-win32.whl

Cannot open include file: 'libxml/xpath.h': No such file or directory的更多相关文章

  1. Solve error: Cannot open include file: 'X11/Xlocale.h': No such file or directory

    When you use FLTK with VS2010, you may get the error: fatal error C1083: Cannot open include file: ' ...

  2. grep: /usr/include/php/main/php.h: No such file or directory

    异常 grep: /usr/include/php/main/php.h: No such file or directory grep: /usr/include/php/Zend/zend_mod ...

  3. 编译openwrt时报错:FMCGenericError.h:34:27: fatal error: libxml/parser.h: No such file or directory

    解决办法: 更新openwrt的feeds,并重新make menuconfig ./script/feeds update -a ./script/feeds install -a

  4. 全志TinaLinux编译错误fatal error: unicode/ucnv.h: No such file or directory

    今天开始正式干活了 拿到一个全志Tina的板子还有一个SDK压缩包,要求我这周(只剩一天半...)就要把sdk编译通过并且把板子跑起来. 还特别跟我说他们试了下这个sdk编译没法通过,会报错... 竟 ...

  5. mac安装扩展出现grep: /usr/include/php/main/php.h

    在Mac下执行 sudo phpize时提示: grep: /usr/include/php/main/php.h: No such file or directorygrep: /usr/inclu ...

  6. libxml/HTMLparser.h file

    在导入asihttprequest包时出问题导入了libxml2.dylib,但是却提示libxml/HTMLparser.h file not found,那是因为你的开发环境默认的路径无法找到这个 ...

  7. libxml/HTMLparser.h file not found

    在导入asihttprequest包时出问题导入了libxml2.dylib.可是却提示libxml/HTMLparser.h file not found. 这是由于你的开发环境默认的路径无法找到这 ...

  8. UI进阶 XML解析适配 'libxml/tree.h'file not found 错误解决办法

    Xcode 'libxml/tree.h'file not found 错误解决办法

  9. (转)win7 64 安装mysql-python:_mysql.c(42) : fatal error C1083: Cannot open include file: 'config-win.h': No such file or directory

    原文地址:http://www.cnblogs.com/fnng/p/4115607.html 作者:虫师 今天想在在win7 64位环境下使用python 操作mysql 在安装MySQL-pyth ...

随机推荐

  1. 基于网络的 Red Hat 无人值守安装

    基于网络的 Red Hat 无人值守安装 本文介绍了 PC 平台上的一种快速 Red Hat Linux 安装方案.它具有很高的自动化程度--用户只需手工启动机器并选择从网络启动,就可以完成整个安装过 ...

  2. KVO 开发详情

    目录 概念 应用KVO的3个步骤 关联属性的KVO 手动管理KVO通知 一.概念 KVO全称是 Key-Value Observing ,是OC的一种消息发送机制.这个机制是指:假设将B对象注册为A对 ...

  3. JVM内存区域配置

    堆内存:新域+旧域 设置堆内存初始化大小 java -Xms128m 设置堆内存初始化大小128MB 设置堆内存最大大小 java -Xmx256m 设置堆内存最大256MB 通常将堆内存的初始化大小 ...

  4. 【bzoj1412】[ZJOI2009]狼和羊的故事 网络流最小割

    题目描述 “狼爱上羊啊爱的疯狂,谁让他们真爱了一场:狼爱上羊啊并不荒唐,他们说有爱就有方向......” Orez听到这首歌,心想:狼和羊如此和谐,为什么不尝试羊狼合养呢?说干就干! Orez的羊狼圈 ...

  5. 【题解】MUTC2013idiots

    我是先知道的这题是FFT然后再做的,知道是FFT其实就是个套路题啦.首先,我们容易发现 \(P = \frac{a}{b}\) 其中a表示合法的方案数,而b表示全部的方案数. b的值即为\(C\lef ...

  6. BZOJ1934 [Shoi2007]Vote 善意的投票 【最小割】

    题目 幼儿园里有n个小朋友打算通过投票来决定睡不睡午觉.对他们来说,这个问题并不是很重要,于是他们决定发扬谦让精神.虽然每个人都有自己的主见,但是为了照顾一下自己朋友的想法,他们也可以投和自己本来意愿 ...

  7. nowcoder 提高组模拟赛 选择题 解题报告

    选择题 链接: https://www.nowcoder.com/acm/contest/178/B 来源:牛客网 题目描述 有一道选择题,有 \(a,b,c,d\) 四个选项. 现在有 \(n\) ...

  8. 【CF edu 30 A. Chores】

    time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standa ...

  9. 【HDU 4300 Clairewd’s message】

    Clairewd is a member of FBI. After several years concealing in BUPT, she intercepted some important ...

  10. final变量属性小记

    final 修饰符对于类成员变量来说,具备语法上不可变的特性:对于类成员方法来说,具备语法上子类不可覆盖重写的特性(能被继承的前提下). 但 final 并不限制子类对父类被修饰声明的成员变量进行覆盖 ...