我gedit-latex-plugin
在 Ubuntu Vivid 中安装时aptitude
没有出现错误。尝试在编辑通过偏好设置 > 插件导致运行时错误并且插件无法激活。
如能提供任何关于如何解决这一问题的提示,我将不胜感激。
完整的错误输出如下:
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'
在 GUI 中它看起来像这样:
答案1
此错误在之前的 Ubuntu 版本中已经报告过。该插件在新系统上运行良好,但在版本升级后的系统上却出现故障。
由于这是 Python(一种解释型语言),因此可以注释掉调用 D-Bus 的有问题的指令。使用您最喜欢的文本编辑器打开 Python 脚本:
sudo gedit /usr/lib/gedit/plugins/latex/job.py
然后注释掉第 160 行,即在前面添加一个井号;它应该是这样的:
# dbus.service.Object.__init__(self, bus_name, OBJECT_PATH)
GEdit 应立即用不同的颜色显示此行。到目前为止,尚未报告注释此指令后产生的任何次要后果。
然后重新启动 GEdit 并再次尝试激活该插件。