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

后端 未结 15 2110
礼貌的吻别
礼貌的吻别 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 21:11

    This worked for me on 10.8.5

    1. Install Xcode from Mac App Store
    2. Xcode -> Preferences -> Downloads -> Command Line Tools
    3. Install homebrew using
    4. ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)"
    5. brew install libxml2
    6. sudo easy_install lxml

    This comprises suggestions from:

    • https://stackoverflow.com/a/6545556/300224
    • https://stackoverflow.com/a/5785013/300224
    • https://stackoverflow.com/a/9403589

    But I wanted to compile it into one answer rather than leave comments everywhere

    0 讨论(0)
  • 2020-11-30 21:14

    Easy_install can work using this:

    STATIC_DEPS=true easy_install 'lxml>=2.2beta4'

    you may then need to run, depending on permissions;

    STATIC_DEPS=true sudo easy_install 'lxml>=2.2beta4'

    see http://muffinresearch.co.uk/archives/2009/03/05/install-lxml-on-osx/

    0 讨论(0)
  • 2020-11-30 21:14

    I compile it in /usr/local without any issues whatsoever.

    Install Python, libxml2, libxslt and then lxml. You might need setuptools installed too.

    0 讨论(0)
提交回复
热议问题