Question

Here are the details of my python install:

  • OS X 10.9
  • homebrew used to install pyenv (https://github.com/yyuu/pyenv)
  • python was installed via pyenv install 2.7.6
  • custom virtualenv just for this project

Given the above python install, how would someone set up libxml2?

So far, I've tried brew install libxml2, hacking the recipe to have --with-python. That seems to compile, but then python starts having SegFaults when I try to use libxml2.

Thanks in advance!

Was it helpful?

Solution 2

Found the solution.

brew install libxml2 --with-python

Some files were installed into /usr/local/lib/python2.7/site-packages/libxml2*. I copied them to my virtualenv's site-packages and voila things worked!

Symlinking might be something better to try.

OTHER TIPS

It may possibly be related to packages being compiled against old libxml2. You can check libxml2 origin with gdb, run gdb python and execute command that lead to SegFault.

One option why it is happening is that brew installed libxml2 to local folder, say /usr/local, and your packages are compiled against libraries shipped with OS (usually old and buggy on OSX, not sure for Mavericks) from /usr/lib are being used.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top