當我嘗試在MacOSX 10.7.5上安裝lxml並使用Homebrew和pip時,遇到很多問題。我有安裝了命令行工具的Xcode 4.6.3。這裏是我的具體步驟:在MacOSX 10.7.5上安裝lxml時出現錯誤:
$ export CC=llvm-gcc-4.2
$ export CXX=llvm-g++-4.2
$ brew install --use--llvm libxml2
$ brew install --use-llvm libxslt
$ sudo pip install lxml
沖泡安裝成功完成,但PIP安裝使我有以下錯誤:
error: command 'cc' failed with exit status 1
完整的日誌是在這裏:https://gist.github.com/sloria/5902993
當我嘗試使用easy_install:
$ sudo easy_install lxml
我得到一個不同的錯誤:
error: Setup script exited with error: command 'cc' failed with exit status 1
完整的日誌在這裏:https://gist.github.com/sloria/5903014
這到底是怎麼回事?
錯誤明顯是列出:' '的libxml/xmlversion.h' 文件不found' – chrisaycock