[英]How to deal with: ImportError: /usr/lib/x86_64-linux-gnu/libatk-1.0.so.0: undefined symbol: g_log_structured_standard
I have a MacBook Pro on which I installed VirtualBox, installed Anaconda (from https://www.continuum.io ), and installed OpenCV ( conda install -c menpo opencv
)我有一台 MacBook Pro,在上面安装了 VirtualBox,安装了 Anaconda(来自https://www.continuum.io ),并安装了 OpenCV(
conda install -c menpo opencv
)
Executed Python:执行的Python:
python
Python 2.7.14 |Anaconda, Inc.| (default, Dec 7 2017, 17:05:42)
[GCC 7.2.0] on linux2
and tried to import OpenCV:并尝试导入 OpenCV:
>>> import cv2
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: /usr/lib/x86_64-linux-gnu/libatk-1.0.so.0: undefined symbol: g_log_structured_standard
I Googled the error, but there are not many entries about that, and the ones I found were unsolved.我在谷歌上搜索了这个错误,但关于这个的条目并不多,我发现的那些都没有解决。 I do not understand even what is the error about, so no clue how to solve it.
我什至不明白错误是什么,所以不知道如何解决它。 I have installed Anaconda and OpenCV many times on other systems without problems.
我已经在其他系统上多次安装了 Anaconda 和 OpenCV,没有出现问题。
Any idea how to solve this error?知道如何解决这个错误吗?
yeah,i check that,update the lib is ok.是的,我检查了一下,更新库没问题。 use the commend
conda install -c anaconda glib
使用命令
conda install -c anaconda glib
In Ubuntu 18.04 it seems that problem is opposite to what @VamsidharReddyGaddam was supposing.在 Ubuntu 18.04 中,问题似乎与 @VamsidharReddyGaddam 假设的相反。
I checked: grep -l g_log_structured_standard /usr/lib/x86_64-linux-gnu/*glib*.so* # and grep -l g_log_structured_standard ~/anaconda3/lib/*glib*so*
我检查了:
grep -l g_log_structured_standard /usr/lib/x86_64-linux-gnu/*glib*.so* # and grep -l g_log_structured_standard ~/anaconda3/lib/*glib*so*
and first find
was successful and second not.第一次
find
成功,第二次没有。
I suppose that /usr/lib/x86_64-linux-gnu/libatk-1.0.so.0
is compiled/linked against newer libglib
( /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.5600.1
on ubuntu 18.04) than which one is installed by anaconda ( ~/anaconda3/lib/libglib-2.0.so.0.5306.0
in this moment).我想
/usr/lib/x86_64-linux-gnu/libatk-1.0.so.0
是针对较新的libglib
( /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.5600.1
on ubuntu 18.04) 而不是由 anaconda 安装的(此时为~/anaconda3/lib/libglib-2.0.so.0.5306.0
)。
So different dirty hack could "help":所以不同的肮脏黑客可以“帮助”:
in Ubuntu 18.04.在 Ubuntu 18.04 中。 :/ (I am suspicious that it could bring different problems later!!!)
:/(我怀疑它以后会带来不同的问题!!!)
How could we fill issue at anaconda?我们如何在 anaconda 上填写 issue?
For me, I realized my anaconda was running on python3.7 and the python program it was referring to was in the anaconda folder, I switched to system wide python interpreter running version 3.9 and it worked for me.对我来说,我意识到我的 anaconda 在 python3.7 上运行,它所指的 python 程序在 anaconda 文件夹中,我切换到运行 3.9 版的系统范围的 python 解释器,它对我有用。 See if it works for your too.
看看它是否也适合你。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.