1

I installed gedit-latex-plugin in Ubuntu Vivid via aptitude without errors. Trying to activate the plugin in gedit via Preferences > Plugins results in a runtime error and the plugin not getting activated.

Any hints on how to tackle this would be very much appreciated.

The full error output is like follows:

Traceback (most recent call last):
  File "/usr/lib/gedit/plugins/latex/__init__.py", line 38, in <module>
    from .appactivatable import LaTeXAppActivatable
  File "/usr/lib/gedit/plugins/latex/appactivatable.py", line 24, in <module>
    from .config import MENUACTIONS
  File "/usr/lib/gedit/plugins/latex/config.py", line 79, in <module>
    from .bibtex.editor import BibTeXEditor
  File "/usr/lib/gedit/plugins/latex/bibtex/editor.py", line 35, in <module>
    from ..job import Job, JobChangeListener
  File "/usr/lib/gedit/plugins/latex/job.py", line 202, in <module>
    job_manager = JobManager()
  File "/usr/lib/gedit/plugins/latex/job.py", line 160, in __init__
    dbus.service.Object.__init__(self, bus_name, OBJECT_PATH)
  File "/usr/lib/python3/dist-packages/dbus/service.py", line 485, in __init__
    self.add_to_connection(conn, object_path)
  File "/usr/lib/python3/dist-packages/dbus/service.py", line 576, in add_to_connection
    self._fallback)
RuntimeError: To make asynchronous calls, receive signals or export objects, D-Bus connections must be attached to a main loop by passing mainloop=... to the constructor or calling dbus.set_default_main_loop(...)

(gedit:17951): libpeas-WARNING **: Error loading plugin 'latex'

And in the GUI it looks like this:

gedit Latex plugin not getting activated

3
  • I just installed this package in Ubuntu 15.04 64 bit and it is working correctly. Could you try to re-install: sudo apt-get install --reinstall gedit-latex-plugin ? Jun 1, 2015 at 12:21
  • Thanks for your reply, Luís. I did the reinstall but it still fails activating. Jun 2, 2015 at 12:59
  • I also reinstalled the packages dbus and dbus-x11 as the python stack trace points to some error related to dbus. But I don't really understand at all what is going on in that add_to_connection function in service.py. It seems as if there is some kind of problem connecting to the dbus service. Jun 2, 2015 at 13:44

1 Answer 1

1

This error has been reported in previous Ubuntu versions. This plug-in works perfectly on a fresh system, but happens to fail on systems resulting from release upgrades.

Since this is Python (an interpreted language) it is possible to comment out the offending instruction where D-Bus is invoked. Open the Python script with your favourite text editor:

sudo gedit /usr/lib/gedit/plugins/latex/job.py 

Then comment out line 160, i.e., add an hash character in front; it should look like this:

# dbus.service.Object.__init__(self, bus_name, OBJECT_PATH)

GEdit should immediately portrait this line in a different colour. So far no secondary consequences have been reported with this instruction commented out.

Then restart GEdit and try again to activate the plug-in.

3
  • The plugin works in Ubuntu 15.04, also without comment out this line. Have you tested the solution?
    – A.B.
    Jun 3, 2015 at 15:16
  • Thanks again, Luís! I am able to activate the latex plugin after commenting out line 160 in job.py. My Ubuntu 15.04 was a fresh install, not an upgraded system. It would still be great to find out why something and what exactly is going wrong with dbus. I recently deleted ~/.dbus because I assmued it is only temporary data that gets recreated anyway. Now I see that I still have no .dbus directory in my home even after a restart. I wonder if there might something generally going wrong with dbus on my system. Jun 3, 2015 at 16:04
  • I have a ~/.dbus folder, but I doubt it is related to the error you are getting. I suspect more of some particular Python package modifying the usage of D-Bus. If you want to get to the bottom of this you might open a bug at launchpad or at GNome's Bugzilla. Jun 4, 2015 at 7:17

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .