0

Everything was working fine with my python install on Linux Mint. Then all of a sudden I tried:

import matplotlib.pyplot as plt
GConf-WARNING **: Client failed to connect to the D-BUS daemon
Qt: Session management error: Could not open network socket

So I updated Qt with Anaconda to v5.6 and I deleted the matplotlib cache per this question:

conda update qt
rm -r ~/.cache/matplotlib

That got rid of the GConf error, but I still get

import matplotlib.pyplot as plt
Qt: Session management error: Could not open network socket

This just started happening all of a sudden and I'm not sure what changed. Any thoughts on where to start? Matplotlib still works and runs, it is just annoying to have an error like this pop up all of a sudden.

I was able to resolve the issue through two fixes (both worked independently of the other):

First, I changed the backend to TkAgg in matplotlibrc file, or I opened the ipython config file and set c.InteractiveShellApp.pylab = 'tk'.

I don't mind this fix, using Tk vs Qt, I just don't know why the errors popped up all of a sudden.

Community
  • 1
  • 1
Nate
  • 1,888
  • 3
  • 18
  • 26
  • Try the command: `unset SESSION_MANAGER` or try remove username cache (on KDE: `rm -rf /var/tmp/kdecache-username/*`) – Luca Angioloni Dec 17 '16 at 03:13
  • What does unset SESSION_MANAGER do? Are there any other consequences? Also, the odd thing about the error is that it only happens some times. After a reboot, it doesn't happen (but sometimes it does?) – Nate Dec 19 '16 at 17:13
  • There shouldn't be other consequences. – Luca Angioloni Dec 19 '16 at 17:38
  • @LucaAngioloni what causes this issue to come up in the first place? It's sporadic as well, doesn't always happen. – Nate Dec 23 '16 at 18:41

1 Answers1

0

I had the same error message on Gnome on Debian. The following worked for me. Delete matplotlib's old cached files for Qt session. In my case, they were in my conda's virtual environment folder under:

site-packages/matplotlib/backends/qt_editor/

and

site-packages/matplotlib/backends/qt_editor/__pycache__/

Arktik
  • 263
  • 3
  • 13