自制安装带有python模块的libxml2 [英] Homebrew install libxml2 with python modules
问题描述
早上好
我正在尝试使用python模块安装libxml2.我尝试了以下方法:
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
您可以看到...即使使用--with-python标志,它仍在配置没有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
当我尝试安装gnome-doc-utils软件包时:
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.
推荐答案
首先,您无法安装libxml2,因为您已经成功安装了它,因此您首先需要将其卸载.
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 --
类型
brew edit libxml2
并更改行
system "./configure", "--prefix=#{prefix}", "--without-python"
对此:
system "./configure", "--prefix=#{prefix}", "--with-python"
这不能解决brew公式的问题,但是会强制标记"--with-python",因此,下次键入brew install libxml2
时,它将安装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.
如果您需要重置公式(撤消更改),只需键入brew update
If you need to reset the formula (undo your changes), simply type brew update
这篇关于自制安装带有python模块的libxml2的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!