Homebrew installs libxml2 with python modules

Good morning,

I am trying to install libxml2 with python modules. I tried the following:

brew install --with-python libxml2 ==> Downloading ftp://xmlsoft.org/libxml2/libxml2-2.8.0.tar.gz Already downloaded: /Users/brandon/Library/Caches/Homebrew/libxml2-2.8.0.tar.gz ==> ./configure --prefix=/usr/local/Cellar/libxml2/2.8.0 --without-python 

As you can see ... even with the --with-python flag, it still configures the source without python!

At the end of the installation, the homegrown says:

 Generally there are no consequences of this for you. If you build your own software and it requires this formula, you'll need to add its lib & include paths to your build variables: LDFLAGS -L/usr/local/Cellar/libxml2/2.8.0/lib CPPFLAGS -I/usr/local/Cellar/libxml2/2.8.0/include 

When I try to install the gnome-doc-utils package:

 Gnome-doc-utils requires libxml2 to be compiled with the python modules enabled, to do so: $ brew install libxml2 --with-python 

So I tried again ...

 ╰─ brew install libxml2 --with-python Error: libxml2-2.8.0 already installed 

I'm still new to this ... so any help would be greatly appreciated.

+8
python homebrew libxml2 macos
source share
3 answers

Firstly, you cannot install libxml2 because you have already successfully installed it, so you need to remove it first.

brew uninstall libxml2

Next, you will need to edit the brew formula, which is simple enough to do -

type brew edit libxml2 and change the line

 system "./configure", "--prefix=#{prefix}", "--without-python" 

:

 system "./configure", "--prefix=#{prefix}", "--with-python" 

This does not fix the problem with the brew formula, but it forces the --with-python flag, so the next time you enter brew install libxml2 it will install the python libraries.

If you need to reset the formula (discard the changes) just enter brew update

+14
source share

It worked for me. Unplug / uninstall first if done earlier:

 brew unlink libxml2 brew unlink libxslt brew uninstall libxml2 brew uninstall libxslt 

Then

 brew install --framework python brew install --with-python libxml2 brew install --with-python libxslt brew link libxml2 --force brew link libxslt --force 

Voila!

+7
source share

Libxml2 was installed to work with --with-python in the brew command

 brew install --with-python libxml2 
+3
source share

All Articles