Ubuntu: Why does pylint Gedit plugin give me an error when I try to enable it?

Question:

I downloaded and installed the pylint gedit plugin. I then copied the pylint.gedit_plugin file and the pylint directory to

/usr/lib/gedit/plugins

I couldn't see it in the gedit plugins menu so I renamed pylint.gedit_plugin to pylint.plugin and changed the first line of the file from

[Gedit Plugin]

to

[Plugin]

Now I can see it in the menu. But when I select it, the red circle error icon appears and I cannot enable to plugin. What else do I need to do to use the plugin? Any help is appreciated.

Solution:1

This is a good question, as it is sometimes tricky to setup the pylint plugin for gedit. The following tutorial was tested with gedit 3.4.1 on 12.04.

1) The first thing you need to do is install pylint itself from the repositories, as without this program, the pylint plugin won't work. So please run:

sudo apt-get install pylint

This is the necessary dependency and is not the plugin itself, and it should install as well python-logilab-common and python-logilab-astng, which are also necessary.

2) You may be using the wrong version of the plugin. It is of foremost importance that you use the forked version of the pylint plugin from the Launchpad page, which is called gedit-pylint-2, as that supports gedit 3.x versions; other versions of the plugin will not work with gedit 3.x. (However, if you are using an earlier version of gedit than 3.x, you should use the 1.1 version of the pylint plugin from the Launchpad page.)

Download the latest version of the source: it does not need compiling, but it is important to follow my installation procedure, as parts of the included README in the download are inaccurate. (I recommend you start again and follow this guide, as it worked for me. You should not need to tweak or rename anything, as you say you are doing.)

Move to the folder with the downloaded file (after checking the md5) and extract it with

tar -xzvf gedit-pylint-2-2.1.tar.gz cd gedit-pylint-2-2.1

Now, you can actually install it to ~/.local/share/gedit/plugins without placing it in any of the system directories. I should remove your installed version, and install it again as detailed below, as I think you had the wrong version anyway: the plugin name must be pylint-2.plugin, not pylint.gedit_plugin.

Now, run gedit and enable the plugin from edit > preferences > plugins (screenshot 1), and you will be able to use it from tools > pylint (screenshot 2). Make sure you have the bottom panel enabled, as that is where the output from the plugin will go (screenshot 3).

1) Enable the plugin from preferences:

2) It should be listed in the tools menu:

3) You can now analyse your python scripts: note the bottom pane is enabled. Click 'check' in the bottom pain to run the plugin.

Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com