I'm trying to install a markdown preview plugin for gedit, but when I try to active it, the entry greys out.

Running gedit via the terminal, I get the following error message:

Traceback (most recent call last):
  File "/home/<userid>/.gnome2/gedit/plugins/markdown-preview/__init__.py", line 31, in <module>
    from gpdefs import *
ImportError: No module named gpdefs

** (gedit:2107): WARNING **: Error loading plugin 'Markdown Preview'

Trying to find gpdefs, I only found one potentially related page, which suggest I needed gedit-plugins installed, which I did but this didn't seem to have any effect (other than assorted new plugins).

Any suggestions?

  • gpdefs.py should be in the PYTHONPATH at that point but manifestly isn't. I don't know whose job it is to make it so. Jun 18, 2011 at 21:50

3 Answers 3


I'm the author of gedit-markdown. Your problem should be fixed in the current version (3.2.1).



For anyone else still experiencing this problem, I managed to get the plugin to activate with a custom script to start up gedit that adds the required dir to PYTHONPATH:

export PYTHONPATH=$PYTHONPATH:/usr/lib/gedit-2/plugins
gedit $1 

I think it is a bug. I tried installing it on Ubuntu 10.10 and, even after installing gedit-plugins, I saw exactly the same error message. This ML entry[1] suggests that the install script is not configuring the plugin correctly:

gpdefs (which stands for gedit-plugins definitions) is a file generated by configure, which basically plays the same role as config.h but for python.

If you install gedit-plugins then gpdefs.py is installed to /usr/lib/gedit-2/plugins/ but, as Gilles notes, the markdown plugin does not add it to the python path.

[1] http://comments.gmane.org/gmane.comp.gnome.apps.epiphany/8711

You must log in to answer this question.

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