python3.4 lxml 安装 LXML模块死活安装不了怎么办

因为要学Scrapy框架来写爬虫,可是每次都是出现这个错误:&br&&p&/private/tmp/pip_build_root/lxml/src/lxml/includes/etree_defs.h:14:10: fatal error: 'libxml/xmlversion.h' file not found&/p&&br&&p&#include &libxml/xmlversion.h&&/p&&br&&p&
^&/p&&br&&p&1 error generated.&/p&&br&&p&error: command '/usr/bin/clang' failed with exit status 1&/p&&br&&p&----------------------------------------&/p&&p&Cleaning up...&/p&&p&Command /Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python -c &import setuptools,__file__='/private/tmp/pip_build_root/lxml/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))& install --record /tmp/pip-ABNSEN-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /private/tmp/pip_build_root/lxml&/p&&p&Storing debug log for failure in /Users/CraxDc/.pip/pip.log&/p&&br&&br&&br&&p&#include &libxml/xmlversion.h&&/p&&br&&p&
^&/p&&br&&p&1 error generated.&/p&&br&&p&error: command '/usr/bin/clang' failed with exit status 1&/p&&br&&br&&p&已经百度谷歌一个下午了,能找到的方法都试过了。Stackoverflow论坛的问题也看过了,都是解决不了。&/p&&br&&br&&img src=&/7a77ddc988b6ae870a798_b.jpg& data-rawwidth=&561& data-rawheight=&359& class=&origin_image zh-lightbox-thumb& width=&561& data-original=&/7a77ddc988b6ae870a798_r.jpg&&
因为要学Scrapy框架来写爬虫,可是每次都是出现这个错误:/private/tmp/pip_build_root/lxml/src/lxml/includes/etree_defs.h:14:10: fatal error: 'libxml/xmlversion.h' file not found#include "libxml/xmlversion.h"
^1 error generated.error: command '/usr/bin/clang' failed with exit status 1----------------------------------------Cleaning up...Command /Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python -c "import setuptools,__file__='/private/tmp/pip_build_root/lxml/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-ABNSEN-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /private/tmp/pip_build_root/lxmlStoring debug log for failure in /Users/CraxDc/.pip/pip.log#include "libxml/xmlversion.h"
^1 error generated.error: command '/usr/bin/clang' failed with exit status 1已经百度谷歌一个下午了,能找到的方法都试过了。Stackoverflow论坛的问题也看过了,都是解决不了。…
用pip安装,提示缺啥,再安装啥。
&p&STATIC_DEPS=true sudo pip install lxml&/p&&br&&p&试试这个?&/p&
STATIC_DEPS=true sudo pip install lxml试试这个?
这问题没那么神秘吧,你要先安装lxml2的c库。这是安装python实现的时候找不到它要封装的c实现在哪里。
这问题没那么神秘吧,你要先安装lxml2的c库。这是安装python实现的时候找不到它要封装的c实现在哪里。
已有帐号?
无法登录?
社交帐号登录Python LXML模块死活安装不了怎么办_百度知道
Python LXML模块死活安装不了怎么办
进入.lfd,命令行运行://www.lfd,注意别改文件名.edu/~gohlke/pythonlibs/#lxml3.whl文件1.edu/~gohlke/pythonlibs/#lxml" target="_blank">http! <a href="http.uci://www.在这里下载对应的.whl所在的文件夹. 安装wheel:pip install wheel2.uci
其他类似问题
为您推荐:
python的相关知识
等待您来回答
下载知道APP
随时随地咨询
出门在外也不愁7854人阅读
python(29)
&&&& 在使用第三方包lxml引入etree模块时报错:
&&& from lxml import etree
Traceback (most recent call last):
File &&stdin&&, line 1, in ?
ImportError: dynamic module does not define init function (initetree)&& 由于之前安装是直接使用源码包进行安装,报错之后决定卸载掉源码安装的版本(直接删除site-packages目录下面的lxml包文件),然后重新使用easy_insall命令安装,安装过程中报错信息如下:
ERROR: /bin/sh: xslt-config: command not found
** make sure the development packages of libxml2 and libxslt are installed **&&& 于是分别安装libxml2 and libxslt模块:
yum install libxml2
yum install libxslt&& 检查xslt-config命令是否安装成功:
[root@oser623 mongodb]# whereis xslt-config
xslt-config:
[root@oser623 mongodb]# && xslt-config命令还是不存在,在网上找了找资料,提示说需要安装&libxslt-devel
yum install libxslt-devel&& 现在再来尝试安装 lxml模块
[root@oser623 mongodb]# whereis xslt-config
xslt-config: /usr/bin/xslt-config
[root@oser623 mongodb]# easy_install lxml
Searching for lxml
Reading http://pypi.python.org/simple/lxml/
Reading http://codespeak.net/lxml
Best match: lxml 2.3.4
Downloading http://lxml.de/files/lxml-2.3.4.tgz
Processing lxml-2.3.4.tgz
Running lxml-2.3.4/setup.py -q bdist_egg --dist-dir /tmp/easy_install-zdolOV/lxml-2.3.4/egg-dist-tmp-QQHSfi
Building lxml version 2.3.4.
Building without Cython.
Using build configuration of libxslt 1.1.17
Building against libxml2/libxslt in the following directory: /usr/lib64
Adding lxml 2.3.4 to easy-install.pth file
Installed /usr/lib/python2.4/site-packages/lxml-2.3.4-py2.4-linux-x86_64.egg
Processing dependencies for lxml
Finished processing dependencies for lxml&& 包导入测试:
[root@oser623 mongodb]# python
Python 2.4.3 (#1, Feb 22 :45)
[GCC 4.1.2
(Red Hat 4.1.2-52)] on linux2
Type &help&, &copyright&, &credits& or &license& for more information.
&&& from lxml import etree
&&& & 安装成功!
参考知识库
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
访问:619976次
积分:7023
积分:7023
排名:第1971名
原创:87篇
转载:75篇
评论:92条
文章:10篇
阅读:30539
(2)(1)(2)(1)(2)(1)(2)(5)(1)(1)(1)(3)(4)(2)(6)(15)(7)(11)(9)(20)(3)(12)(32)(19)怎么安装python的模块?_百度知道
怎么安装python的模块?
最简单的方式是使用pip包管理器,在新版本的python中默认安装pip&install&chardet如果下载的包是whl格式,可以包的名称替换为安装包的路径使用pip安装pip&install&d:\downloads\lxml-3.4.2-cp34-none-win_amd64.whl
其他类似问题
4人觉得有用
为您推荐:
回复 7# wqjwftcaqr 你可以参见我博客里:这个是安装MySQLdb模块的,具体模块名称你可以到: 找
python的相关知识
其他1条回答
解压之后是一个文件夹,不是无后缀的文件。运行CMD,进入这个文件夹,运行“setup.py ins订处斥肺俪镀筹僧船吉tall”就可以安装了。
等待您来回答
下载知道APP
随时随地咨询
出门在外也不愁Python LXML模块死活安装不了怎么办_百度知道
Python LXML模块死活安装不了怎么办
python.2.pip install lxml3python 版本 是多少啊 1
其他类似问题
为您推荐:
等待您来回答
下载知道APP
随时随地咨询
出门在外也不愁}

我要回帖

更多关于 python2.7 安装lxml 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信