python安装软件出现错误 fatal error: 'libxml/xmlversion.h' file not found

1、python2 出现问题的解决办法:

sudo C_INCLUDE_PATH=/Applications/Xcode.app/Contents/Developer/Platforms/AppleTVSimulator.platform/Developer/SDKs/AppleTVSimulator.sdk/usr/include/libxml2:/Applications/Xcode.app/Contents/Developer/Platforms/AppleTVSimulator.platform/Developer/SDKs/AppleTVSimulator.sdk/usr/include/libxml2/libxml:/Applications/Xcode.app/Contents/Developer/Platforms/AppleTVSimulator.platform/Developer/SDKs/AppleTVSimulator.sdk/usr/include pip install Scrapy


问题解决



2、在我用python3 安装lxml的时候出现了同样的错误:

解决办法是:


输入命令:

xcode-select --install

然后再输入命令: 
python3 setup.py install 

安装完成



猜你喜欢

转载自blog.csdn.net/guo_hongjun1611/article/details/50441868