How do you install lxml on OS X Leopard without using MacPorts or Fink?

后端 未结 15 2346
礼貌的吻别
礼貌的吻别 2020-11-30 20:23

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?<

15条回答
  •  忘掉有多难
    2020-11-30 20:58

    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
    

提交回复
热议问题