MAC OSX下用pip安装lxml时遇到xmlversion.h not found的解决办法

        今天在Mac下用pip安装lxml,总是报如下错误:

etree_defs.h:9:10: fatal error: 'libxml/xmlversion.h' file not found

参考http://lxml.de/installation.html的安装文档,用如下命令安装问题依旧。

STATIC_DEPS=true sudo pip install lxml

搜了几个方法都不行,无意间搜到如下文章:http://blog.marchtea.com/archives/91,如法炮制,增加 C_INCLUDE_PATH指定到XCode MacOSX SDK中libxml路径,问题搞定。Mark一下。

sudo C_INCLUDE_PATH=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/include/libxml2:/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/include/libxml2/libxml:/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/include pip install lxml


评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值