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

http://blog.csdn.NET/wave_1102/article/details/37730589

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

etree_defs.h::: 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..sdk/usr/include/libxml2:/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10..sdk/usr/include/libxml2/libxml:/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10..sdk/usr/include pip install lxml  

上面这个指令并不能原班照抄着用,其中MacOSX版本号部分得改成自己系统的版本号,或者到那个父目录里面看一下。

上一篇:解决小米手机USB安装apk时AS报错:INSTALL_FAILED_USER_RESTRICTED


下一篇:excel 拷贝数据到 plsql 报 is not a valid date and time