问题
I'm writing a python program with matplotlib, and I'm getting this error:
GLib-GIO-Message: Using the 'memory' GSettings backend. Your settings will not be saved or shared with other applications.
(python:6304): Gtk-WARNING **: GModule (/usr/lib/x86_64-linux-gnu/gtk-2.0/2.10.0/immodules/im-ibus.so) initialization check failed: GLib >version too old (micro mismatch)
(python:6304): Gtk-WARNING **: Loading IM context type 'ibus' failed
(python:6304): Gtk-WARNING **: GModule (/usr/lib/x86_64-linux-gnu/gtk-2.0/2.10.0/immodules/im-ibus.so) initialization check failed: GLib version too old (micro mismatch)
(python:6304): Gtk-WARNING **: Loading IM context type 'ibus' failed
(python:6304): Gtk-WARNING **: GModule (/usr/lib/x86_64-linux-gnu/gtk-2.0/2.10.0/immodules/im-ibus.so) initialization check failed: GLib version too old (micro mismatch)
(python:6304): Gtk-WARNING **: Loading IM context type 'ibus' failed
The program finishes executing, but the error won't go away. I'm running Ubuntu 16.
I tried reinstalling Glib, but nothing changed. I searched for help online, but couldn't find a solution. I'm a noob and I have no clue how to resolve this.
Can anyone help me out? I really appreciate your time!
回答1:
For others (like me) using the Anaconda Python distribution:
I had the same exact same GTK error messages, despite not having PyGTK installed or in use, in the qt console of Spyder. This began right after I installed a non-default package that automatically downgraded my PyQt version from 5 to 4. I removed it and upgraded the pyqt package, which returned spyder to its normal behavior. I do not know why modifying the pyqt version leads to GTK errors.
Note I used anaconda-navigator for the install / uninstall / ugrade steps, but all of this can be achieved through the usual conda command interface. Also, pyqtgraph was the offending library, but the latest version (0.10) installed via pip install pyqtgraph
doesn't lead to this issue.
回答2:
I found my answer based on this link. In brief I had to manually replace a library with a newer version. In my case, I had to do this for my anaconda environment libraries. Note that searching for the library will replace multiple hits, so you have to find the correct one for your problem...
Here is what i did:
来源:https://stackoverflow.com/questions/38963373/how-can-i-fix-this-error-gtk-warning-gmodule-initialization-check-faile