简体   繁体   中英

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 )

Executed 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:

>>> 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.

Any idea how to solve this error?

yeah,i check that,update the lib is ok. use the commend conda install -c anaconda glib

In Ubuntu 18.04 it seems that problem is opposite to what @VamsidharReddyGaddam was supposing.

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*

and first find was successful and second not.

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).

So different dirty hack could "help":

mv ~/anaconda3/lib/libglib-2.0.so.0 ~/anaconda3/lib/libglib-2.0.so.0.backup

in Ubuntu 18.04. :/ (I am suspicious that it could bring different problems later!!!)

How could we fill issue at anaconda?

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. See if it works for your too.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM