Python 2.7.10的Lxml安装错误

时间:2015-10-08 22:17:29

标签: python python-2.7 lxml

尝试在mac osx yosemite上安装lxml for python 2.7.10

使用命令pip install lxml,我收到:/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/Python.h:33:10:致命错误:'stdio.h'文件未找到     #包括              ^     生成1个错误。     错误:命令'/ usr / bin / clang'失败,退出状态为1

完成错误:命令“/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python -c”import setuptools,tokenize; file =' /private/var/folders/h2/hwn1y9sd54b6tl2wyb6vc_kh0000gp/T/pip-build-St5xbb/lxml/setup.py';exec(compile(getattr(tokenize,'open',open)( file ) .read()。replace('\ r \ n','\ n'),文件,'exec'))“install --record / var / folders / h2 / hwn1y9sd54b6tl2wyb6vc_kh0000gp / T / pip-8QC6OG-record / install-record.txt --single-version-external-managed --compile“在/ private / var / folders / h2 / hwn1y9sd54b6tl2wyb6vc_kh0000gp / T / pip-build-St5xbb / lxml中失败,错误代码为1

我搜索过但无法找到解决方案。有人可以指出我正确的方向吗?

1 个答案:

答案 0 :(得分:0)

如果您安装了xcode,请尝试以下

  $xcode-select --install

您也可以尝试通过homebrew

安装python
  $brew install python

请参阅与您的问题相关的这些链接。

Fatal error: #include <stdio.h> generated after "pip install mysql-python" command

GCC fatal error: stdio.h: No such file or directory