在Mac OS X上安装libxml2遇到的问题

2024-05-18 18:29:11 发布

您现在位置:Python中文网/ 问答频道 /正文

我正试图在我的Mac(OS 10.6.4)上安装libxml2。实际上,我只是想用Python运行一个小脚本,它要求我安装Twisted、Zope和libxml2。我已经下载了最新版本(2.7.7,来自xmlsoft.org),并尝试按照以下说明操作here。总而言之,我尝试了这个命令(在python子目录中):

python setup.py --static-deps --libxml2-version=2.7.7 -- libxslt-version=1.1.24

最后我犯了个错误:

failed to find headers for libxml2: update includes_dir

有什么想法吗?

我还尝试运行此命令:

./configure --with-python=/System/Library/Frameworks/Python.framework/Versions/2.6/

我得到以下错误:

configure: error: no acceptable C compiler found in $PATH

这能说明情况吗?


Tags: org命令版本脚本zopehereosversion
3条回答

你不应该改写--libxml2-version=2.7.7吗?

我知道这是一个旧线程,但我只是在安装pip依赖项时遇到这个错误。

failed to find headers for libxml2: update includes_dir

我通过使用

xcode-select --install

希望这能帮助其他找到这条线索的人。

我知道如何安装libxml2。它走了两步。首先,我没有安装XCode,所以我必须从Apple开发工具下载并安装它。我以为这是OX10.6.4的标准,但我想不是。

然后,在libxml2文件夹中运行以下三个命令:

./configure --with-python=/System/Library/Frameworks/Python.framework/Versions/2.3/
make
sudo make install

之后,我切换到libxml2文件夹的Python子目录,并运行一个通用设置:

python setup.py install

在那之后,一切都准备好了。

相关问题 更多 >

    热门问题