python xml模块安装_自制安装带有python模块的libxml2 - Go语言中文社区

python xml模块安装_自制安装带有python模块的libxml2


Good morning,

I'm trying to install libxml2 with python modules. I have 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 is still configuring the source without python!

At the end of the install, homebrew 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 obviously 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.

解决方案

First, you cannot install libxml2 because you already successfully installed it, so you will first need to uninstall it.

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"

to this:

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

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

If you need to reset the formula (undo your changes), simply type brew update

版权声明:本文来源CSDN,感谢博主原创文章,遵循 CC 4.0 by-sa 版权协议,转载请附上原文出处链接和本声明。
原文链接:https://blog.csdn.net/weixin_35070219/article/details/111949392
站方申明:本站部分内容来自社区用户分享,若涉及侵权,请联系站方删除。
  • 发表于 2021-05-31 07:36:16
  • 阅读 ( 611 )
  • 分类:

0 条评论

请先 登录 后评论

官方社群

GO教程

猜你喜欢