如何在不使用MacPorts或Fink的情况下在OS X Leopard上安装lxml? [英] How do you install lxml on OS X Leopard without using MacPorts or Fink?
本文介绍了如何在不使用MacPorts或Fink的情况下在OS X Leopard上安装lxml?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我尝试过这种方法,过去曾遇到很多问题.有没有人知道在没有MacPorts或Fink的情况下可以在OS X上安装lxml的秘诀?
I've tried this and run in to problems a bunch of times in the past. Does anyone have a recipe for installing lxml on OS X without MacPorts or Fink that definitely works?
最好具有完整的1-2-3步骤来下载和构建每个依赖项.
Preferably with complete 1-2-3 steps for downloading and building each of the dependencies.
推荐答案
感谢Twitter上的@jessenoller我有一个适合我需要的答案-您可以编译具有静态依赖项的lxml,从而避免与操作系统附带的libxml2发生冲突X.这是对我有用的东西:
Thanks to @jessenoller on Twitter I have an answer that fits my needs - you can compile lxml with static dependencies, hence avoiding messing with the libxml2 that ships with OS X. Here's what worked for me:
cd /tmp
curl -O http://lxml.de/files/lxml-3.6.0.tgz
tar -xzvf lxml-3.6.0.tgz
cd lxml-3.6.0
python setup.py build --static-deps --libxml2-version=2.7.3 --libxslt-version=1.1.24
sudo python setup.py install
这篇关于如何在不使用MacPorts或Fink的情况下在OS X Leopard上安装lxml?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文