Bra*_*don 10 python macos homebrew libxml2
早上好,
我正在尝试使用python模块安装libxml2.我尝试过以下方法:
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
Run Code Online (Sandbox Code Playgroud)
正如你所看到的......即使使用--with-python标志,它仍然在没有python的情况下配置源代码!
在安装结束时,自制软件说:
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
Run Code Online (Sandbox Code Playgroud)
当我尝试安装gnome-doc-utils包时:
Gnome-doc-utils requires libxml2 to be compiled
with the python modules enabled, to do so:
$ brew install libxml2 --with-python
Run Code Online (Sandbox Code Playgroud)
显然我再试一次......
?? brew install libxml2 --with-python
Error: libxml2-2.8.0 already installed
Run Code Online (Sandbox Code Playgroud)
我还是新手......所以任何帮助都会非常感激.
kyl*_*uff 18
首先,您无法安装libxml2,因为您已成功安装它,因此您首先需要将其卸载.
brew uninstall libxml2
接下来,您需要编辑brew配方 - 这很简单 -
输入
brew edit libxml2并更改该行
system "./configure", "--prefix=#{prefix}", "--without-python"
Run Code Online (Sandbox Code Playgroud)
对此:
system "./configure", "--prefix=#{prefix}", "--with-python"
Run Code Online (Sandbox Code Playgroud)
这并没有解决brew公式的问题,但它确实强制标志"--with-python",所以下次你输入brew install libxml2它时会安装python库.
如果您需要重置公式(撤消更改),只需键入即可 brew update
这对我有用.如果先前完成,首先取消链接/卸载:
brew unlink libxml2
brew unlink libxslt
brew uninstall libxml2
brew uninstall libxslt
Run Code Online (Sandbox Code Playgroud)
然后
brew install --framework python
brew install --with-python libxml2
brew install --with-python libxslt
brew link libxml2 --force
brew link libxslt --force
Run Code Online (Sandbox Code Playgroud)
瞧!