在Mac OS X上安装libxml2的问题 [英] Problems installing libxml2 on Mac OS X

查看:3463
本文介绍了在Mac OS X上安装libxml2的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在我的Mac(OS 10.6.4)安装了libxml2。实际上,我想只要运行在Python,这要求我安装扭曲,Zope的,现在的libxml2一个Scrapy脚本。我已经下载了最新版本(2.7.7,从xmlsoft.org),并试图按照这些指示<一个href=\"http://stackoverflow.com/questions/1277124/how-do-you-install-lxml-on-os-x-leopard-without-using-macports-or-fink\">here.总之,我试过这个命令(在Python子目录):

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

任何想法?

我也试过运行此命令:

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

和我得到以下错误:

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

这是否对局势有何启示?

Does that shed any light on the situation?

推荐答案

我想通了,如何让安装了libxml2。它走了两步。首先,我没有安装X code,所以我必须要获得下载和从苹果开发工具安装。我认为它已经开了OX 10.6.4标准,但我不这样想。

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.

然后,在libxml2的文件夹,我跑这三个命令:

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

在这之后,我切换到文件夹的libxml2的Python的子目录,然后跑了一个通用的设置:

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.

这篇关于在Mac OS X上安装libxml2的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆