Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

gedit plugin error - plugin loader 'python3' was not found

I tried to add some plugins in gedit 3.10.4 on ubuntu 14.04LTS and some errors occured when I try to activate those plugins in gedit:

(gedit:20686): libpeas-WARNING **: Error initializing Python Plugin Loader: PyGObject initialization failed ImportError: could not import gobject (error was: ImportError("No module named 'gi'",))

(gedit:20686): libpeas-WARNING **: Please check the installation of all the Python related packages required by libpeas and try again

(gedit:20686): libpeas-WARNING **: Loader 'python3' is not a valid PeasPluginLoader instance

(gedit:20686): libpeas-WARNING **: Could not find loader 'python3' for plugin 'bracketcompletion'

And I see, on ged

plugin loader 'python3' was not found

Does anyone have an idea from where the problem could come?

like image 426
Julien LM Avatar asked Mar 10 '15 13:03

Julien LM


2 Answers

I had this very same error with a different plugin (reST). The problem the error was caused by was that I had run it from the command line when a virtual environment was active. For this reason Python3 did not use (and find) the system libraries.

Solution: I ran gedit just normally from the GUI (or after deactivating the virtualenv in the Terminal), and the editor and the plugin just loaded fine. Double-check if you have a similar cause.

Otherwise you probably really have to check on what the error message says: Whether all "related packages required by libpeas" are installed. See details of package libpeas-1.0-0 for Trusty.

like image 87
Peterino Avatar answered Oct 23 '22 02:10

Peterino


To add to @Railslide 's answer:

  1. In your /usr/lib/gedit/plugin search for your plugin file (e.g. bracketcompletion.plugin) and change Loader=python3 to Loader=python

  2. If this still returns an error - likely because it doesn't match python3 syntax: Use the command 2to3 as follows:

    cd python_directory/
    sudo 2to3 -f all -w *
    

e.g. for gedit-latex-plugin...

cd /usr/lib/gedit/plugins/
sudo sed -i 's/python/python3/g' latex.plugin # only if you haven't already replaced python->python3
cd latex/
sudo 2to3 -f all -w *

Then this fixes the plug-in by replacing python2.x code with python3 code

Related

  • Activating gedit-latex-plugin fails in Vivid
  • Gedit 3.8.3 only supports python3 plugins
like image 32
Alexander McFarlane Avatar answered Oct 23 '22 04:10

Alexander McFarlane