8

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!

Community
  • 1
  • 1
James
  • 81
  • 1
  • 3
  • Seems it has been answered here : http://askubuntu.com/questions/806064/glib-gio-message-and-gtk-warning-on-ubuntu-16-04 – fpietka Aug 15 '16 at 21:44
  • 16.04 or 16.10 beta? – andlabs Aug 15 '16 at 21:51
  • @fpietka there is no answer there, just some misguided "advice" – andlabs Aug 15 '16 at 21:51
  • 1
    It's not **error**, it is **warning**. If you don't have any problems then simply ignore it. – Ipor Sircer Aug 15 '16 at 23:10
  • 1
    What I'm thinking is if it happens with all GTK based programs, the issue (if any, seems it works) must be in the package. So may be more related to the distribution. – fpietka Aug 16 '16 at 12:01
  • @IporSircer that's a very bad way of thinking. You should worry about warnings just as much as errors; warnings are trying to tell you there's a bug that *could become a problem*. In this case the bug is likely in the distribution and *should be investigated*. – andlabs Aug 16 '16 at 13:08
  • @andlabs then fill a bugreport, it's not your problem until it works. – Ipor Sircer Aug 16 '16 at 13:15
  • It could be your problem; it depends on what the warning says. `Assertion 'GTK_SOMETHING (widget) != NULL' failed` is a pretty good indicator you screwed up something with your code, but it doesn't crash the program either. – andlabs Aug 16 '16 at 13:35
  • What happens if you run http://pastie.org/10937021? Are you using ibus for alternate input methods? (Open question.) – andlabs Aug 17 '16 at 17:09
  • @andlabs Thank you for your help!! I'm on 16.04. Apparently, I don't even have GTK installed. Now I'm trying to install PyGTK and PyGObject with anaconda, but I'm getting errors. PyGTK gives me `Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-8wwtm3vb/PyGTK/`, and anaconda says pygobject3 3.18.2* is in conflict with python 3.5. Any suggestions? I have no idea what I'm doing. – James Aug 18 '16 at 17:37
  • Don't bother with anaconda; install the packages directly from the Ubuntu package repositories (`sudo apt-get install python-gtk python-gobject python3-gobject gir1.2-gtk-2.0`, though some of those package names may be wrong). For python-gobject, you'll need to change the import lines. – andlabs Aug 18 '16 at 17:43
  • apt-get was unable to locate python-gtk. Python-gtk2 was already installed. I looked for anything else related to gtk but found nothing. Any ideas? – James Aug 20 '16 at 18:00
  • I wouldn't know, sorry. At this point, I can only suggest filing a bug report on Launchpad. Good luck. – andlabs Aug 21 '16 at 15:55
  • maybe late and not sure, but when I use screenftech I got the first GLib-GIO-Message: blabla... the reason is anaconda hijacked gsetting. solution is rename anaconda gsetting like this man does. [Gsettings not working (to change wallpaper)](https://ubuntu-mate.community/t/gsettings-not-working-to-change-wallpaper/13867/15) I like it. – roachsinai Mar 21 '18 at 05:14

2 Answers2

0

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.

Jack
  • 82
  • 1
  • 8
  • The question is dealing with GTK warning not with Qt. Please try to answer to the question correctly. – Chiheb Nexus Dec 02 '16 at 03:20
  • I agree it seems they should be unrelated, since they are separate GUI libraries. Nonetheless, I got the same GTK errors listed above for some reason, despite the fact that my environment (Spyder) is qt-based, as are the scripts I was running. I actually don't even have PyGTK installed. I am happy to take this answer down, but it may help others in my situation. – Jack Dec 03 '16 at 23:37
  • Agree, this answer might be value to some, so would leave it. On the other hand it does not answer the question, so it is definatly not "THE" answer. I suspect the two issues are related and what you endup doing is installing an older pyqtgraph (so instead of updating the lib in the system, you downgraded your python...) – ntg Jan 26 '19 at 05:46
0

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: enter image description here

ntg
  • 12,950
  • 7
  • 74
  • 95