在MacOS下Python安装lxml报错找不到头文件 xmlversion.h 的解法方法

来源:互联网 发布:支付宝与淘宝解绑不了 编辑:程序博客网 时间:2024/05/21 08:35
使用 pip install lxml 时出错:
In file included from src/lxml/lxml.etree.c:139:src/lxml/etree_defs.h:9:10: fatal error: 'libxml/xmlversion.h' file not found#include "libxml/xmlversion.h"^1 error generated.

解决方法:
1、xcode-select --install2、C_INCLUDE_PATH=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/libxml2:/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/libxml2//libxml:/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include3、sudo pip install lxml


0 0
原创粉丝点击