我在将 lxml 安装到我的 Mac OS 时遇到问题。构建它时出现以下错误。这是我使用时遇到的错误pip install lxml
/private/var/folders/9s/s5hl5w4x7zjdjkdljw9cnsrm0000gn/T/pip-build-khuevu/lxml/src/lxml/includes/etree_defs.h:9:10:致命错误:找不到“libxml/xmlversion.h”文件
我已经用 brew 安装了 libxml2:
brew install libxml2
brew link libxml2 --force
我是 Mac 新手。在 Ubuntu 中,这意味着必须安装 libxml2-dev 软件包。
更新:这里是 pip.log:
"~/.pip/pip.log" 124L, 8293C requirements_set.install(install_options, global_options, root=options.root_path) 文件 "/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/ 2.7/lib/python2.7/site-packages/pip-1.3.1-py2.7.egg/pip/req.py”,第 1185 行,在安装要求中。安装(install_options,global_options,*args,**kwargs )文件“/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip-1.3.1-py2.7.egg/pip/ req.py”,第 592 行,在安装 cwd=self.source_dir、filter_stdout=self._filter_install、show_stdout=False)文件“/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7 /lib/python2.7/site-packages/pip-1.3.1-py2.7.egg/pip/util.py”,第 662 行,在 call_subprocess % (command_desc, proc.returncode,cwd)) 安装错误:命令 /usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python -c "import setuptools;file ='/private/var/folders/9s/s5hl5w4x7zjdjkdljw9cnsrm0000gn/T/pip-build-khuevu/lxml/setup.py';exec(compile(open( file ).read().replace('\r\n' , '\n'), file , 'exec'))" install --record /var/folders/9s/s5hl5w4x7zjdjkdljw9cnsrm0000gn/T/pip-nsV0iT-record/install-record.txt --single-version-externally-managed在 /private/var/folders/9s/s5hl5w4x7zjdjkdljw9cnsrm0000gn/T/pip-build-khuevu/lxml 中出现错误代码 1 失败
任何的想法 ?非常感谢