python程序中的libxml2.2.dylib参考 [英] libxml2.2.dylib reference in python program

查看:172
本文介绍了python程序中的libxml2.2.dylib参考的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用的python库使用libxml2.2.dylib.我收到此错误消息:

A python library that I'm using uses libxml2.2.dylib. I'm getting this error message:

原因:

Incompatible library version: etree.so requires version 12.0.0 or later, but libxml2.2.dylib provides version 10.0.0

我的系统的libxml2.2.dylib版本较旧,并且位于/usr/lib/中.我使用自制软件下载了最新版本的libxml2.2.dylib,该文件位于/usr/local/Cellar/libxml2/2.9.1/lib/中.

My system's version of libxml2.2.dylib is older and is in /usr/lib/. I downloaded the newest version of libxml2.2.dylib using homebrew, and that is in /usr/local/Cellar/libxml2/2.9.1/lib/.

我希望我的Python应用程序使用该版本,而不是系统使用的版本.

I would like my Python application to use that version instead of the one the system uses.

这是将homebrew文件夹添加到路径的问题吗?

Is this a matter of adding the homebrew folder to the path?

推荐答案

尝试遵循说明此处以构建具有静态依赖项的lxml.这样,您不必担心链接到哪个版本的libxml2libxslt.

Try to follow the instructions here to build lxml with static dependencies. This way you don't have to worry about which version of libxml2 or libxslt it is linked against.

可能会归结为

STATIC_DEPS=true pip install -U lxml

这篇关于python程序中的libxml2.2.dylib参考的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆