当尝试使用sudo pip install lxml来安装lxml 时
会提示
Command "/usr/bin/python -c "import setuptools, tokenize;__file__='/private/tmp/pip-build-Swce2X/lxml/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-bXUbas-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/tmp/pip-build-Swce2X/lxml
使用以下网页的方法
MAC OSX下include头文件缺失引起的问题及解决办法, command line tools 安装
安装command line tools 即可成功安装lxml与Scrapy