在Mac OS X上安装libxml2时出现问题(Problems installing libxml2 on Mac OS X)

我正在尝试在我的Mac上安装libxml2(OS 10.6.4)。 我实际上是想在Python中运行Scrapy脚本,这需要我安装Twisted,Zope和现在的libxml2。 我已经下载了最新版本(2.7.7,来自xmlsoft.org),并尝试按照这些说明进行操作。 总结一下,我尝试了这个命令(在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

这是否说明了这种情况?

I'm trying to install libxml2 on my Mac (OS 10.6.4). I'm actually trying to just run a Scrapy script in Python, which has required me to install Twisted, Zope, and now libxml2. I've downloaded the latest version (2.7.7, from xmlsoft.org) and tried following these instructions here. To summarize, I tried this command (in the python subdirectory):

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

I end up with this error:

failed to find headers for libxml2: update includes_dir

Any ideas?

I also tried running this command:

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

And I get the following error:

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

Does that shed any light on the situation?

最满意答案

我想出了如何安装libxml2。 它花了两个步骤。 首先,我没有安装XCode,所以我必须从Apple Developer Tools下载并安装。 我认为它已成为OX 10.6.4的标准,但我猜不是。

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

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

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

python setup.py install

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

I figured out how to get libxml2 installed. It took two steps. First, I didn't have XCode installed, so I had to get that downloaded and installed from Apple Developer Tools. I thought that it had come standard on OX 10.6.4, but I guess not.

Then, in the libxml2 folder I ran these three commands:

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

After that, I switched to the Python subdirectory of the libxml2 folder, and ran a generic setup:

python setup.py install

After that, everything was ready to go.

更多推荐